¡@

Home 

python Programming Glossary: rate

Why isn't Python very good for functional programming?

http://stackoverflow.com/questions/1017621/why-isnt-python-very-good-for-functional-programming

that doesn't support them can only be classed as a second rate functional programming language Keep in mind that my experience..

How to solve the “Mastermind” guessing game?

http://stackoverflow.com/questions/1185634/how-to-solve-the-mastermind-guessing-game

branch and bound Python generators itertools decorate undecorate pattern In answering this question I wanted to build.. and bound Python generators itertools decorate undecorate pattern In answering this question I wanted to build up a language.. the approach will terminate. I use the standard python decorate undecorate pattern together with the built in max method to..

time length of an mp3 file

http://stackoverflow.com/questions/119404/time-length-of-an-mp3-file

what I've got . Also as is it'll only handle constant bit rate MPEG 1 Audio Layer 3 files. That should cover most but I can't.. MPEG 1 not 2 or 2.5 Audio Layer 3 not 1 or 2 constant bit rate not variable #include iostream #include fstream #include cstdlib.. #include fstream #include cstdlib using namespace std Bitrates assuming MPEG 1 Audio Layer 3 const int bitrates 16 0 32000..

Music Recognition and Signal Processing

http://stackoverflow.com/questions/2068286/music-recognition-and-signal-processing

with several songs for each song in 1. reduce quality bit rate to 64kbps for instance and calculate the sound hash have the.. you want to identify for the song in 3. reduce quality bit rate again to 64kbps and calculate sound hash if 4. sound hash is.. the matched music I though of reducing the quality bit rate due to the environment noises and encoding differences. Am I..

Python frequency detection

http://stackoverflow.com/questions/2648151/python-frequency-detection

custom protocol to send data trough sound need very low bitrate per sec 5 10bps but im also very limited on the transmiting.. ago and you can take it or leave it. It won't be as accurate as using the algorithms in aubio but it might be good enough.. well on test tones but it will not be as robust or as accurate as the other methods mentioned above. The accuracy can be increased..

Detect and record a sound with python

http://stackoverflow.com/questions/2668442/detect-and-record-a-sound-with-python

stream p.open format pyaudio.paInt16 channels 1 rate 44100 input True frames_per_buffer chunk data stream.read..

How do I filter ForeignKey choices in a Django ModelForm?

http://stackoverflow.com/questions/291945/how-do-i-filter-foreignkey-choices-in-a-django-modelform

name ... company models.ForeignKey Company base_rate models.ForeignKey Rate I.e. there are multiple Companies each.. an explicit form you'll have fields named directly. form.rate.queryset Rate.objects.filter company_id the_company.id If you.. If you take the default ModelForm object form.fields rate .queryset ... This is done explicitly in the view. No hacking..

Why is printing to stdout so slow? Can it be sped up?

http://stackoverflow.com/questions/3857052/why-is-printing-to-stdout-so-slow-can-it-be-sped-up

so slow Can it be sped up I've always been amazed frustrated with how long it takes to simply output to the terminal with.. in the current screen configuration at a sensible frame rate. So if I can write fsync to disk in ~0.1 seconds a terminal.. What am I missing Here is the python program used to generate the timing import time sys tty import os lineCount 100000 line..

Executing command line programs from within python [duplicate]

http://stackoverflow.com/questions/450285/executing-command-line-programs-from-within-python

import os os.system 'sox input.wav b 24 output.aiff rate v L b 90 48k' This whole setup seems a little unstable to me...

What is the best real time plotting widget for wxPython?

http://stackoverflow.com/questions/457246/what-is-the-best-real-time-plotting-widget-for-wxpython

50 samples of data on both curves with a reasonable update rate for the display 5..10 fps should be okay . Edited to add I have..

Efficient Numpy 2D array construction from 1D array

http://stackoverflow.com/questions/4923617/efficient-numpy-2d-array-construction-from-1d-array

will not be the same as x.size for your new array. At any rate hopefully that makes things slightly clearer.. share improve..

Using strides for an efficient moving average filter

http://stackoverflow.com/questions/4936620/using-strides-for-an-efficient-moving-average-filter

I see this working Current code use stride_tricks to generate an array like 0 1 2 1 2 3 2 3 4 ... which corresponds to the.. specialized functions. Such as scipy.ndimage etc At any rate here's how you do it import numpy as np def rolling_window_lastaxis.. return rolling_window_lastaxis a window for i win in enumerate window if win 1 a a.swapaxes i 1 a rolling_window_lastaxis a..

Analyze audio using Fast Fourier Transform

http://stackoverflow.com/questions/604453/analyze-audio-using-fast-fourier-transform

1024 bytes of a 16 bit dual channel 44 100 Hz sample rate audio stream and averaging the amplitude of the 2 channels together... and showing the combined frequencies. If you want two separate displays for right and left frequencies than you need to perform..

Django Passing Custom Form Parameters to Formset

http://stackoverflow.com/questions/622982/django-passing-custom-form-parameters-to-formset

forms.ModelChoiceField queryset ServiceOption.objects.none rate forms.DecimalField widget custom_widgets.SmallField units forms.IntegerField..

Programmatically generate video or animated GIF in Python?

http://stackoverflow.com/questions/753190/programmatically-generate-video-or-animated-gif-in-python

generate video or animated GIF in Python I have a series of images that.. specify a frame duration for each frame but a fixed frame rate would be fine too. I'm doing this in wxPython so I can render..

Java raw audio output

http://stackoverflow.com/questions/7782721/java-raw-audio-output

share improve this question It is pretty simple to generate a sound in memory. E.G. The important part of generating the.. and storing it in a Clip is encompassed in this code Generates a tone and assigns it to the Clip. public void generateTone.. a tone and assigns it to the Clip. public void generateTone throws LineUnavailableException if clip null clip.stop clip.close..

Detect & Record Audio in Python

http://stackoverflow.com/questions/892199/detect-record-audio-in-python

p pyaudio.PyAudio stream p.open format FORMAT channels 1 rate RATE input True output True frames_per_buffer CHUNK_SIZE num_silent.. wf.setnchannels 1 wf.setsampwidth sample_width wf.setframerate RATE wf.writeframes data wf.close if __name__ '__main__' print..

PyAudio Input overflowed

http://stackoverflow.com/questions/10733903/pyaudio-input-overflowed

import sys chunk 1024 FORMAT pyaudio.paInt16 CHANNELS 1 RATE 44100 RECORD_SECONDS 5 WAVE_OUTPUT_FILENAME output.wav p pyaudio.PyAudio.. stream p.open format FORMAT channels CHANNELS rate RATE input True frames_per_buffer chunk print recording all for.. chunk print recording all for i in range 0 RATE chunk RECORD_SECONDS data stream.read chunk all.append data..

Simultaneous record audio from mic and play it back with effect in python

http://stackoverflow.com/questions/17711672/simultaneous-record-audio-from-mic-and-play-it-back-with-effect-in-python

recordAudio CHUNK 1024 FORMAT pyaudio.paInt16 CHANNELS 1 RATE 44100 RECORD_SECONDS 3 WAVE_OUTPUT_FILENAME audioOriginal.wav.. stream p.open format FORMAT channels CHANNELS rate RATE input True frames_per_buffer CHUNK print recording frames.. CHUNK print recording frames for i in range 0 int RATE CHUNK RECORD_SECONDS data stream.read CHUNK frames.append data..

Python frequency detection

http://stackoverflow.com/questions/2648151/python-frequency-detection

'test tones 440hz.wav' 'rb' swidth wf.getsampwidth RATE wf.getframerate # use a Blackman window window np.blackman chunk.. wf.getsampwidth channels wf.getnchannels rate RATE output True # read some data data wf.readframes chunk # play.. y2 y0 # find the frequency and output it thefreq which x1 RATE chunk print The freq is f Hz. thefreq else thefreq which RATE..

Detect tap with pyaudio from live mic

http://stackoverflow.com/questions/4160175/detect-tap-with-pyaudio-from-live-mic

pyaudio.paInt16 SHORT_NORMALIZE 1.0 32768.0 CHANNELS 2 RATE 44100 INPUT_BLOCK_TIME 0.05 INPUT_FRAMES_PER_BLOCK int RATE.. 44100 INPUT_BLOCK_TIME 0.05 INPUT_FRAMES_PER_BLOCK int RATE INPUT_BLOCK_TIME # if we get this many noisy blocks in a row.. self.pa.open format FORMAT channels CHANNELS rate RATE input True input_device_index device_index frames_per_buffer..

Detect & Record Audio in Python

http://stackoverflow.com/questions/892199/detect-record-audio-in-python

wave THRESHOLD 500 CHUNK_SIZE 1024 FORMAT pyaudio.paInt16 RATE 44100 def is_silent snd_data Returns 'True' if below the 'silent'.. 'seconds' float r array 'h' 0 for i in xrange int seconds RATE r.extend snd_data r.extend 0 for i in xrange int seconds RATE.. r.extend snd_data r.extend 0 for i in xrange int seconds RATE return r def record Record a word or words from the microphone..

Classes within python part 1 [closed]

http://stackoverflow.com/questions/18026306/classes-within-python-part-1

def getWeeksPay self hours if rate is 0 raise Exception Rate not set return hours self.rate def __str__ self stringRep First..

How do I filter ForeignKey choices in a Django ModelForm?

http://stackoverflow.com/questions/291945/how-do-i-filter-foreignkey-choices-in-a-django-modelform

in my models.py class Company models.Model name ... class Rate models.Model company models.ForeignKey Company name ... class.. models.ForeignKey Company base_rate models.ForeignKey Rate I.e. there are multiple Companies each having a range of Rates.. I.e. there are multiple Companies each having a range of Rates and Clients . Each Client should have a base Rate that is chosen..

difficulties with python assignment

http://stackoverflow.com/questions/3954671/difficulties-with-python-assignment

file. This is what I have so far empName prevYTD 0.0 payRate 0.0 hoursWorked 0.0 recordCount 0 def startUp global empFile.. 30 Previous YTD .ljust 18 Updated YTD .ljust 18 Pay Rate .ljust 13 Hours Worked .ljust 19 Current Pay .ljust 8 print.. r def readFile global empName prevYTD payRate hoursWorked eof empRec jobInfo.readline if empRec eof True..

Throttling with urllib2

http://stackoverflow.com/questions/456649/throttling-with-urllib2

token bucket. EDIT 2 Combined both codes into one example. Rate limiters with shared token bucket. import os import sys import.. value self._tokens self.lock.release return value class RateLimit object Rate limit a url fetch. source http mail.python.org.. self.lock.release return value class RateLimit object Rate limit a url fetch. source http mail.python.org pipermail python..

Cron works on local host but not when deployed Appengine

http://stackoverflow.com/questions/4722315/cron-works-on-local-host-but-not-when-deployed-appengine

search APIs does not support authentication. Search API Rate Limiting Requests to the Search API hosted on search.twitter.com.. requests coming from an IP address are applied to a Search Rate Limit. The Search Rate Limit isn't made public to discourage.. IP address are applied to a Search Rate Limit. The Search Rate Limit isn't made public to discourage unnecessary search usage..

Java raw audio output

http://stackoverflow.com/questions/7782721/java-raw-audio-output

addHarmonic harmonic.isSelected int intSR Integer sampleRate.getSelectedItem .intValue int intFPW framesPerWavelength.getValue.. int intFPW framesPerWavelength.getValue float sampleRate float intSR oddly the sound does not loop well for less than.. 2 intFPW wavelengths AudioFormat af new AudioFormat sampleRate 8 sample size in bits 2 channels true signed false bigendian..