Questions tagged [pyaudio]

PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library.

PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio streams on a variety of platforms (e.g. GNU/Linux, Microsoft Windows and Mac OS X).

Sources:

  1. http://pypi.python.org/pypi/PyAudio/
  2. http://people.csail.mit.edu/hubert/pyaudio/
1375 questions
21
votes
5 answers

Installing pyaudio with pip in a virtualenv

I'm trying to install pyaudio with pip: pip install pyaudio In a virtualenv but I'm getting an error: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Entire output: Collecting pyaudio Using cached PyAudio-0.2.9.tar.gz Building…
mertyildiran
  • 6,477
  • 5
  • 32
  • 55
20
votes
11 answers

AttributeError: Could not find PyAudio; check installation...can't use speech Recognition

I'm trying to make a basic speech Recognition assistant. When I run the code, it tells me: Traceback (most recent call last): File "C:\Users\Mo.haytham\AppData\Local\Programs\Python\Python37\lib\site-packages\speech_recognition\__init__.py", line…
Mo .haytham
  • 231
  • 1
  • 2
  • 7
20
votes
7 answers

PyAudio failed to install on Windows 10

When I am trying to install PyAudio using pip install pyaudio I get this error: C:\Users\pankajkaun>pip install pyaudio Collecting pyaudio Using cached…
Pankaj Kaundal
  • 1,012
  • 3
  • 13
  • 25
19
votes
2 answers

Converting a Python function with a callback to an asyncio awaitable

I want to use the PyAudio library in an async context, but the main entry point for the library only has a callback-based API: import pyaudio def callback(in_data, frame_count, time_info, status): # Do something with data pa =…
Migwell
  • 18,631
  • 21
  • 91
  • 160
19
votes
3 answers

Synchronizing audio and video with OpenCV and PyAudio

I have gotten both OpenCV and PyAudio working however I am not sure how I would sync them together. I am unable to get a framerate from OpenCV and measuring the call time for a frame changes from moment to moment. However with PyAudio it's basis is…
Zimm3r
  • 3,369
  • 5
  • 35
  • 53
17
votes
2 answers

Could not build wheels for pyaudio, since package 'wheel' is not installed

I tried to install pyaudio, but it returns an error like this: Could not build wheels for pyaudio, since package 'wheel' is not installed. How can I fix this?
Sih Jie
  • 241
  • 1
  • 3
  • 5
17
votes
5 answers

How can I do real-time voice activity detection in Python?

I am performing a voice activity detection on the recorded audio file to detect speech vs non-speech portions in the waveform. The output of the classifier looks like (highlighted green regions indicate speech): The only issue I face here is making…
Nickil Maveli
  • 29,155
  • 8
  • 82
  • 85
15
votes
7 answers

pyaudio could not import _portaudio

Trying to run python app that uses pyaudio. Using virtualenv and installations are working. However when running it can't find portaudio. But the _portaudio.so file exists. Any suggestions??? (venv) kidkic@pi-mirror1:~/audio $ jasper/jasper.py…
roady
  • 597
  • 2
  • 6
  • 20
15
votes
1 answer

Unknown PCM cards.pcm.rear (pyaudio)

The question is related to this pydub-Issue. They told me the error message is related to pyaudio. #!/usr/bin/env python3 import pydub, pydub.playback wav = pydub.AudioSegment.from_wav('/home/user/complete.wav') pydub.playback.play(wav) This code…
buhtz
  • 10,774
  • 18
  • 76
  • 149
13
votes
3 answers

Linux - Without hardware soundcard, capture audio playback, and record it to file

Is such a thing even possible? Is there a possibility to create a virtual sound card and then use for example PyAudio to listen to its output and save it to a file? NOTE that there is no hardware soundcard present on the machine. I have tried a lot…
Paweł Duda
  • 1,713
  • 4
  • 18
  • 36
13
votes
1 answer

Convert multi-channel PyAudio into NumPy array

All the examples I can find are mono, with CHANNELS = 1. How do you read stereo or multichannel input using the callback method in PyAudio and convert it into a 2D NumPy array or multiple 1D arrays? For mono input, something like this works: def…
endolith
  • 25,479
  • 34
  • 128
  • 192
12
votes
3 answers

How to read stream of .wav bytes in python

Is there a way to read frames of .wav format binary data? I am streaming .wav binary to a python server which I want to be able to read and use from processing by pyaudio, which complains about the frame size. Since I cannot use…
user7993435
12
votes
1 answer

Capture 192 kHz audio using Python 3

I need to capture 192 kHz audio for some bioacoustics experiments using Python 3. I have the hardware, a Sound Devices USBPre 2 sound card, a microphone with good frequency response curve up to 100 kHz, and I have enabled my os (ubuntu 13.04) to…
user2936487
  • 121
  • 1
  • 4
11
votes
1 answer

Python Librosa with Microphone input

So I am trying to get librosa to work with a microphone input instead of just a wav file and have been running to a few problems. Initially I use the pyaudio library to connect to the microphone but I am having trouble translating this data for…
Vince
  • 119
  • 2
  • 8
11
votes
9 answers

How do I install PyAudio on Python 3.7?

I am currently trying to install PyAudio on Python 3.7 but when I use the command "pip install pyaudio", an error message appears: "command 'cl.exe' failed: No such file or directory". I have already tried to modify the PATH but it doesn't work.…
Cyrielle Albert
  • 129
  • 1
  • 2
  • 7
1
2
3
91 92