I have a raspberry pi model B, running speech_recognition 4.1 and pyaudio 0.2.8, and I am using a Logitech usb mincrophone. When I try and start speech recognition using with sr.Microphone() as source: audio = r.listen(source)(which I got from the github page), I get this error
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1438
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2742
Traceback (most recent call last):
File "AI.py", line 62, in
with sr.Microphone(0) as source:
File "/usr/local/lib/python2.7/dist-packages/SpeechRecognition-1.4.0-py2.7.egg/speech_recognition/init.py", line 61, in enter
input = True, # stream is an input stream
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 747, in open
stream = Stream(self, args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 442, in init
self._stream = pa.open(*arguments)
IOError: [Errno Invalid number of channels] -9998
The part at the bottom IOError: [Errno Invalid number of channels] -9998 I had got before when I specified the wrong number of channels in a pyaudio script, but here I am not specifying any channels