Cannot install pyaudio, gcc error

Sorry about the inappropriate answer last time, I will post the solution of the question. It might be helpful for Ubuntu distributions. First we need to install portaudio modules: sudo apt-get install libasound-dev Download the portaudio archive from: http://files.portaudio.com/download.html Unzip the archive: tar -zxvf [portaudio.tgz] Enter the directory, then run: ./configure && make Install: sudo … Read more

What are chunks, samples and frames when using pyaudio

“RATE” is the “sampling rate”, i.e. the number of frames per second “CHUNK” is the (arbitrarily chosen) number of frames the (potentially very long) signals are split into in this example Yes, each frame will have 2 samples as “CHANNELS=2”, but the term “samples” is seldom used in this context (because it is confusing) Yes, … Read more

PyAudio Input overflowed

pyaudio.Stream.read() has a keyword parameter exception_on_overflow, set this to False. For your sample code that would look like: import pyaudio import wave 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 = … Read more

PyAudio working, but spits out error messages each time

You can try to clean up your ALSA configuration, for example, ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side are caused by /usr/share/alsa/alsa.conf: pcm.rear cards.pcm.rear pcm.center_lfe cards.pcm.center_lfe pcm.side cards.pcm.side Once you comment out these lines, those error message will be gone. You may also want … Read more

when installing pyaudio, pip cannot find portaudio.h in /usr/local/include

Since pyAudio has portAudio as a dependency, you first have to install portaudio. brew install portaudio Then try: pip install pyAudio. If the problem persists after installing portAudio, you can specify the directory path where the compiler will be able to find the source programs (e.g: portaudio.h). Since the headers should be in the /usr/local/include … Read more