Questions tagged [pyaudio]

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

pyaudio
754 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
0 answers
4k views

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred

I'm trying to code a voice chat using socket and pyaudio in python. I wrote it and it works but it raises errors which are these ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave ...
Miad Abdi's user avatar
  • 911
9 votes
0 answers
2k views

Trying to understand PyAudio error: [Errno -9981] Input overflowed

I am trying to do a sound processing project with PyAudio, but I sometimes get this error and I don't understand why. The following code plays back audio heard on my laptop mic, and then pauses for ...
pyjamas's user avatar
  • 4,920
8 votes
1 answer
7k views

PyAudio throws ´unable to open slave` error

Hi every time i execute pyauido.PyAudio() i get the following error. I try to display the audio recorded by my mic using these instructions: https://swharden.com/wp/2016-07-19-realtime-audio-...
Schotti100's user avatar
7 votes
0 answers
346 views

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 ...
JohannesKrabbe's user avatar
7 votes
0 answers
2k views

How to get the current selected audio device in python?

I'm using python to get the current selected audio device in windows. I'm using pyaudio now and open to use other libs. What I have achieved: with pyaudio's get_device_info_by_index I can list all ...
vego's user avatar
  • 949
6 votes
0 answers
4k views

Bytes into Numpy Int16 array

How can I convert an audio sample that came out of pyaudio, which is a bytes object, into a numpy array of signed-int16 samples?
ArekBulski's user avatar
  • 4,838
6 votes
0 answers
1k views

Capturing system audio with PyAudio

I'm trying to capture the system output audio on Windows, Mac and Linux using PyAudio but am having mixed results. Right now I am doing this: self.p = pyaudio.PyAudio() self.inStream = self.p.open(...
Adam Haile's user avatar
5 votes
0 answers
470 views

Crash while using Pyaudio to record audio on Mac M1

After struggling for a long time, I have finally managed to install the Pyaudio library on my MacBook M1. It can play audio files smoothly, but it crashes when I try to record audio. The error message ...
Henrik's user avatar
  • 51
5 votes
1 answer
446 views

Python RPI : How do i dynamically adjust the volume of my wav file currently playing

Currently using Raspberry Pi 3, pyaudio , ReSpeaker 2-Mics Pi HAT How do I adjust the volume of the .wav file playing using python in RPI? ( the output is through respeaker 3.5mm audio jack connected ...
JustASimpleGuy's user avatar
5 votes
0 answers
623 views

Raspbian - ALSA error while using pyaudio

I got error starting like below Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924 ...
Mishra's user avatar
  • 51
5 votes
1 answer
4k views

Recording or Playing Audio with Python not working on Mac: No Errors & No Sound

I'm trying to work with Audio on Python 3.7 on Mac(Catalina) only with the built-in Microphone and Speakers. My Problem is that with any code I tried, when recording I receive nothing and when playing ...
vincirist's user avatar
  • 113
5 votes
0 answers
907 views

pyaudio: no sound recorded

I have some problem using pyaudio. I am working on ubuntu 18.04 using python 3.6.7, pyaudio version 0.2.11 and have the following dependencies: libportaudiocpp0 portaudio19-dev libportaudio2-dev ...
p.deman's user avatar
  • 594
5 votes
0 answers
4k views

How to create a white noise signal in Python, and filter the noise signal with bandpass filter?

I'm doing a project about speech processing. I wonder how to create a white noise signal in Python, and filter the noise signal with bandpass filter? import pyaudio import numpy as np import scipy....
Roger's user avatar
  • 91
5 votes
0 answers
4k views

PyAudio alsa error messages

I am receiving error messages every time I play a sound with PyAudio and am having trouble supressing them. ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave ...
servvs's user avatar
  • 72
5 votes
2 answers
2k views

PyAudio Over Network crashes

Hello I am facing an issue with PyAudio I can not solve. When I use it over the network (after a while) it crashes. The error I get is Exception in thread Thread-1: Traceback (most recent call last): ...
james's user avatar
  • 51
4 votes
0 answers
425 views

Mac M1 and Pyaudio. ||PaMacCore (AUHAL)|| AUHAL component not found

I´m using a Macbook M1 and I'm trying to use Pyaudio on Python, but the following error appears: |**|PaMacCore (AUHAL)|| AUHAL component not found.** .... stream = audio.open(format=FORMAT, channels=...
Maria José Pinto Bernal's user avatar
4 votes
0 answers
1k views

pyaudio: unable to open slave [ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave]

I had an xkcd979 moment - this post is the exact same problem I had, but it has no replies! So, here it is: I'm working with pyaudio on a clean, new Pi Zero 2, and it's erroring with the following: ...
Dan Humphreys's user avatar
4 votes
1 answer
641 views

Detecting Activity with mouse, keyboard and voice on windows

We have a module on Python (through win32) to detect user mouse and keyboard activity by GetLastInputInfo and GetTickCount. How can we register Voice activity in GetLastInputInfo? Or maybe can we add ...
Led's user avatar
  • 672
4 votes
0 answers
1k views

PyAudio How do I find the volume of a certain range of sound frequencies

I am trying to make a program in python which will take in sound frequencies with pyaudio and show ranges of frequencies as bars going up and down using turtle. I want it to look something like this: ...
Ethan Posner's user avatar
4 votes
1 answer
2k views

OSError: No Default Input Device Available using CoLAB

Unable to use the SpeechRecognition lib in CoLAB. Code: import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: print("Speak Anything: ") audio = r.listen(source)...
Sarbajit Roy's user avatar
4 votes
1 answer
211 views

How I can solve pyaudio installation problem in (python3.7 64bit)

when I am install pyadio through cmd there was genrate error that is ***Collecting pyaudio Complete output from command "c:\users\this pc\appdata\local\programs\python\python37\python.exe" -u -c "...
Dev's user avatar
  • 41
4 votes
1 answer
1k views

Python - Record on loop, stop recording when silent

I am trying to write a Python script that will record 5-second segments of speech on a loop for as long as the user is speaking, and will stop after three wave files of pure silence. How would I go ...
Christopher Costello's user avatar
4 votes
1 answer
4k views

How do I get PyAudio 0.2.11 version

When I run the bingtest.py, I am getting the error below. I have tried using the command sudo pip install PyAudio But it doesn't seem to work. Traceback (most recent call last): File "...
Mikasa's user avatar
  • 339
4 votes
0 answers
1k views

Python PyAudio Portaudio invalid input device

I want to do something like this: Get an audio sample as float number from pyaudio-stream I'm new to Python and installed PyCharm with all necessary packages. PyAudio creates some problems I'm unable ...
dtea's user avatar
  • 41
4 votes
0 answers
684 views

PyAudio is clipping the end of sound

I have written/am still playing with a software FSK modem written in python using PyAudio. At first I was modulating the sound into a *.wav file and then playing it at a later time however this is not ...
Tom Martin's user avatar
3 votes
0 answers
290 views

Deep Learning Model not working on Raspberry Pi 4 (ALSA ISSUES for USB Microphone)

I am working on a Trigger Word Detection System. I need to run the model on Raspberry Pi. The Code is working absoulutely fine on Windows PC. But on rasberry I am getting alot of warning with respect ...
Inderpreet Singh's user avatar
3 votes
0 answers
278 views

pyaudio installation error ( #include <stdio.h> command 'clang' failed with exit status 1)

I'm trying to install pyaudio in mac having python 64 bit, using the command "pip3 install pyaudio", by getting the below error. Installing collected packages: pyaudio Running setup....
Sambit Kumar's user avatar
3 votes
0 answers
774 views

Not Getting Audio Output With PyAudio on Raspberry Pi 4

Kind of at a loss here. Currently the below code doesn't play a wav file as it should. I added some print statements and discovered that the while loop never finishes. I'm using a Raspberry Pi 4. I ...
ptan9o's user avatar
  • 286
3 votes
0 answers
2k views

ALSA errors using PyAudio on Raspberry Pi 4

Not sure why this is happening. Trying to get a simple PyAudio example working on my Raspberry Pi 4. The code... import pyaudio p = pyaudio.PyAudio() Results in the following errors. Expression '...
ptan9o's user avatar
  • 286
3 votes
0 answers
557 views

There is no python-for-android recipe available for Pyaudio

I have just lost hope on the speech recognition in Kivy for creating an APK with Buildozer. But when we use speech recognition in a Kivy code and build the APK with Buildozer. During building it gives ...
Amit Nikhade's user avatar
3 votes
0 answers
295 views

Pyaudio - I can't record more than 10 seconds.What could be the issue?

I'm developing a screen recorder with Tkinter and Pyaudio but i'm encountering some issues:I can not record more than 10 seconds.For example if i try to record 1 minute of video, i can only get 10 ...
Greg's user avatar
  • 55
3 votes
0 answers
2k views

How to generate frequency sweep sound in python

So I'm trying to generate a controllable tone with python. I'm using PyAudio and the simple code is like this (source): import pyaudio import numpy as np p = pyaudio.PyAudio() fs = 44100 # ...
juliussin's user avatar
  • 295
3 votes
0 answers
364 views

Python Pyaudio or other library: how to access audio stream of internal audio?

I'm trying to stream audio playing internally. Currently, my script has a more hardware based solution where the audio outputs through the auxiliary out which connects to a USB auxiliary line-in ...
www139's user avatar
  • 5,125
3 votes
0 answers
377 views

Pyaudio: Audio playback sounds horrible when using WASAPI driver

When I select WASAPI as my host API, any wav file I play sounds garbled. If I choose MME, it sounds fine. If I play the same wav file with Audacity and choose WASAPI as the host, this sounds fine ...
Ronnie O's user avatar
3 votes
0 answers
1k views

Recorded sound gets noisy/distorted when datatype is 32 bit float

I recorded sound from microphone on my computer by python with pyaudio. It works fine when sound is recorded in 16 bit integer as its data type. However, it does not work when it is recorded in 32 bit ...
Wave's user avatar
  • 111
3 votes
0 answers
862 views

Finding out volume of a frequency range in PyAudio/FFT

My goal is to write a Python program that records sound from a microphone and prints the volume of a specific frequency range (using a bandpass filter) continuously. Below is the code which I ...
Daniel Marschall's user avatar
3 votes
1 answer
1k views

Recording and playing audio simultaneously with PyAudio and NumPy

Currently i can record audio and save it as a NumPy array. What i need is after audio has been recorded i want to be able to record again but play this NumPy array at the same time import pyaudio ...
TooSharpForYou's user avatar
3 votes
1 answer
1k views

How to get left output using pyAudio

Suppose I have a song, which plays on both of the speakers on my headphones. I want to write a code using pyAudio, so that I get output on only on speaker. Like those videos demonstrating left-right ...
Kaptain Kirk's user avatar
3 votes
1 answer
694 views

MemoryError when dividing NumPy arrays

I'm trying to calculate the impulse response of a signal. Here is the code: def impulse_response(self): # Inverse filter: T = self.recorded_data.shape[0] / self.samplerate t = np.arange(0,...
rub123's user avatar
  • 51
3 votes
1 answer
2k views

PyAudio stream.is_active(), how does it know whether it is active or not

I am trying understand how stream.is_active() works. say the wave file reader example from the Documentation: """PyAudio Example: Play a wave file (callback version).""" import pyaudio import wave ...
J_yang's user avatar
  • 2,702
3 votes
0 answers
71 views

push-to-listen-into-the-past with pyaudio

Essentially, what I want to achieve is upon triggering, the previous two seconds and further audio should be recorded, until silence. For this, of course, the microphone has to listen all the time ...
phisch's user avatar
  • 170
3 votes
1 answer
1k views

segmentation fault :pyaudio recording in no blocking mode

I've been trying to record audio using pyaudio untill silence is met in the input stream .but segmentation fault happens while running it .i don't think anything is wrong with pyaudio/portaudio ...
Arjun Biju's user avatar
3 votes
0 answers
2k views

Questions about real time audio signal processing with PyAudio and PyQtGraph

I need to do some real time audio signal processing with Python, i.e. analyze the signal in the frequency domain by framing, windowing and computing the FFT, and then apply some filters depending on ...
Philippe Gonzalez's user avatar
3 votes
1 answer
2k views

Real time audio processing in Python

I'm writing a program to check for glitches in an audio signal recorded by a computer. After audio has been detected, I would like to check for glitches in the first 5 seconds of data ( corresponding ...
CJF's user avatar
  • 51
3 votes
1 answer
2k views

PyAudio - multiple channel management \ Demixing

I want to calculate the single channel data (in order to calculate the audio cross correlation between the channel 1 and channel 4) of this code: import time import numpy as np import pyaudio import ...
Davide Glerean's user avatar
3 votes
2 answers
1k views

Mac os El Capitan recording sound with python

I'm trying to record sound from mic. Firstly as used PyAudio then sounddevice but both failed. Here is code for PyAudio: import pyaudio def _recording_loop(samples_queue, running, stream, ...
Long Smith's user avatar
  • 1,359
3 votes
0 answers
2k views

PyAudio: Multichannel Sound

I'm working on an experiment concerned with spatial sound perception. In this experiment, different sounds should be simultaneously presented from up to eight speakers. For this purpose, I would like ...
Malte's user avatar
  • 31
3 votes
0 answers
1k views

List devices with PyAudio on Linux

When listing audio devices on Linux (I tried with Raspbian / RaspberryPi) with: import pyaudio p = pyaudio.PyAudio() for i in range(p.get_device_count()): print p.get_device_info_by_index(i) I ...
Basj's user avatar
  • 44.1k
3 votes
0 answers
2k views

PyAudio issue with libasound_module_conf_pulse.so

I am using the Anaconda Python distribution on a Dell E6520 laptop running Ubuntu 14.04 LTS (x86_64) with ALSA and PortAudio installed - "aplay -L" shows the default audio device as "HDA Intel PCH, ...
Bryan G's user avatar
  • 31
3 votes
0 answers
190 views

python pyaudio bindings not executes sometimes

I have downloaded and installed the pyaudio and portaudio. For code 1,it works perfectly all the time without producing any errors. The code 2, I have posted below works sometimes successfully.But ...
user avatar

1
2 3 4 5
16