How to fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory”
Try This, CMD as Administrator and run the following: pip install pipwin pipwin install pyaudio
Try This, CMD as Administrator and run the following: pip install pipwin pipwin install pyaudio
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
One way I’ve done it: read a block of samples at a time, say 0.05 seconds worth compute the RMS amplitude of the block (square root of the average of the squares of the individual samples) if the block’s RMS amplitude is greater than a threshold, it’s a “noisy block” else it’s a “quiet block” … Read more
“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.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
I’m assuming you are on a Mac. This is a simple issue to fix. First install Xcode. Then restart your computer. Afterwards run the commands in sequence, xcode-select –install brew remove portaudio brew install portaudio pip3 install pyaudio So to clarify, Xcode is installed through the App Store. Xcode command line tools are required for … Read more
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
Found an answer at https://groups.google.com/forum/#!msg/pyo-discuss/ptp_m39ACpI/XgKdK8YGNSoJ sudo apt-get install portaudio19-dev
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
The answer by Agalin is already great and I just want to explain it in a step by step format for a novice like myself: find your Python version by python –version mine is 3.7.3 for example the easiest way to check either you have 64 or 32 Python just open it in the terminal: … Read more