8

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.

Community
  • 1
  • 1
user426364
  • 160
  • 9

1 Answers1

1

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.

Svend Feldt
  • 758
  • 4
  • 17