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
7
votes
0 answers

Getting the internal audio output of the speaker on macOS with python

I want to get the internal audio output of the speaker on macOS with python. I got it working on Windows but I can't get it running on macOS. At the beginning we used PyAudio, but I figured that SoundDevice is the better option. This is the working…
7
votes
8 answers

Unable to install PyAudio on M1 Mac [PortAudio already installed]

I have visited many forums, tried diffrent methods like brew, pip, port and many more but still am facing the same error. View this Image for more detail src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #include…
Vishal Kumar
  • 73
  • 1
  • 1
  • 3
7
votes
1 answer

how to install portaudio on pi properly

I am working on a project that involves recording from a mic on a raspberry pi. for now i am getting this error while the program is running. python3: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret ==…
Eshaka
  • 974
  • 1
  • 14
  • 38
7
votes
3 answers

How to record system audio (the output from the speaker)?

I have been searching for this since last week. Tried pyaudio also and when I used it and another fork, the system audio was mixed with microphone audio. I was not able to find any other module for this and thus finally asked the question. import…
7
votes
4 answers

Stream audio from pyaudio with Flask to HTML5

I want to stream the audio of my microphone (that is being recorded via pyaudio) via Flask to any client that connects. This is where the audio comes from: def getSound(self): # Current chunk of audio data data =…
paranerd
  • 81
  • 1
  • 1
  • 5
7
votes
1 answer

PyAudio trying to use JACK

I'm running PyAudio under Python 2.6.6 and would like it to use ALSA and not JACK. In [1]: import pyaudio In [2]: pa = pyaudio.pa In [3]: pa.initialize() Cannot connect to server socket err = No such file or directory Cannot connect to server…
Gus
  • 4,375
  • 5
  • 31
  • 50
7
votes
3 answers

How do I get a list of my device's audio sample rates using PyAudio or PortAudio?

I'd like to query my audio device and get all its available sample rates. I'm using PyAudio 0.2, which runs on top of PortAudio v19, on an Ubuntu machine with Python 2.6.
mtrw
  • 34,200
  • 7
  • 63
  • 71
7
votes
1 answer

Trimming audio in python

ok so im using pyaudio as well but from what I been looking at the wave module could maybe help me out here. So im trying to add a trimming function on my program, what I mean is im trying to allow the user to find parts of a wav. that he/she…
Nick yo
  • 75
  • 1
  • 1
  • 8
7
votes
2 answers

C compiler cannot create executables - Cygwin/MiniGW

I'm trying to compile Pyaudio, (a Python module) from source, since I'm using Windows, and only 32-bit binaries are available - I need 64. Following these instructions I downloaded Cygwin, and installed every component, to be safe. Installing…
Turtles Are Cute
  • 3,200
  • 6
  • 30
  • 38
6
votes
1 answer

PyAudio, how to tell frequency and amplitude while recording?

I've used the PyAudio default recording example, and added numpy and scipy. I can only use scipy.io.wavefile.read('FILE.wav'), after recording the file, however, and it also gives me this random tuple, eg: (44100, array([[ 0, 0], [-2, 0], …
jewz
  • 71
  • 1
  • 1
  • 3
6
votes
1 answer

installing pyaudio to docker container

I am trying to install pyaudio to my docker container and I was wondering if anyone had any solution for Windows. I have tried two methods: Method 1: Using pipwin - Error Code: => [3/7] RUN pip install pipwin …
Juliette
  • 4,309
  • 2
  • 14
  • 31
6
votes
1 answer

PyAudio install error after updated to Xcode 12

I have been updated to Xcode 12, but when I trying to install PyAudio, I always got an error like this: (I also tried to install with sudo, with and without venv, which got same error like this...) OS: macOS 10.15.6 (19G2021) Python: 3.8 Xcode…
ljcucc
  • 89
  • 5
6
votes
4 answers

Failed installing pyaudio on Google Colab with "ERROR: Failed building wheel for pyaudio"

Trying to install pyaudio on Google Colab but got an error "ERROR: Failed building wheel for pyaudio". !apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools !pip install pyaudio I got this error: Collecting…
angelokh
  • 9,426
  • 9
  • 69
  • 139
6
votes
1 answer

Speech to text code stuck on "say something":

I am running speech to text code on python 3 by importing speech_recognition and my program stuck on "say something" and showing sudo jack_control start //terminal commmand --- start sudo python speech.py //terminal command terminal…
user11251362
  • 101
  • 2
  • 10
6
votes
3 answers

How to write pyaudio output into audio file?

I currently have the following code, which produces a sine wave of varying frequencies using the pyaudio module: import pyaudio import numpy as np p = pyaudio.PyAudio() volume = 0.5 fs = 44100 duration = 1 f = 440 samples = (np.sin(2 * np.pi *…
George Tian
  • 401
  • 7
  • 16