Skip to content Skip to sidebar Skip to footer

Pyaudio Prints Alsa Warnings And Does Not Work

I am trying to run a basic python speech to text code. This is the code. import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: audio =

Solution 1:

if someone is still looking for getting rid of

ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map

I just commented out all pcm.surround* lines in "PCM interface" section in

/usr/share/alsa/alsa.conf

file and it works fine for me.

Solution 2:

It seems that you have multiple audio input sources, and the first one is not supported by the speech-recognition library. There is another possibility that you have no audio inputs at all.

Try different indexes (e.g. 0, 1, 2, etc) with sr.Microphone(...) as per example below:

with sr.Microphone(device_index=0) as source:

But first, it's a good idea to run cat /proc/asound/card to see what audio devices you've got.

Post a Comment for "Pyaudio Prints Alsa Warnings And Does Not Work"