Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyAudio ErrNo Input Overflowed -9981

Tags:

python

pyaudio

I was getting the same error as the user in

Python, Error audio Recording in 16000Hz using Pyaudio

The error was the same (except for the line numbers) as in the below graphic:

this link

As I was writing this, I found the solution to my problem in this link. The solution was to up the bitrate to 48000. But I had already "been approved" at 44100

if p.is_format_supported(44100.0,  # Sample rate
    input_device=devinfo["index"],
    input_channels=devinfo['maxInputChannels'],
    input_format=pyaudio.paInt16):
print 'Yay!'

Does anyone know why I was approved at 44100 and was overflowing but it works fine at 48000? (I was also approved for 48000).

Ordinarily I am the type of guy to get the solution and move on, but this time, I feel that I need to know. Thank you for your time.

like image 651
user426364 Avatar asked Feb 01 '13 16:02

user426364


1 Answers

Please verify that the device actually support 44.1. Even though the device states it does support it, it's not always actually supporting it.

like image 70
Svend Feldt Avatar answered Nov 03 '22 23:11

Svend Feldt