0

I'm making a project that requires the user to control the raspberry through speech. i installed speech recognition https://pypi.python.org/pypi/SpeechRecognition/3.4.3 i got this error:

pi@raspberrypi:~/SpeechRecognition-3.3.3 $ sudo python -m speech_recognition 
A moment of silence, please...
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/pi/SpeechRecognition-3.3.3/speech_recognition/__main__.py", line 8, in <module>
    with m as source: r.adjust_for_ambient_noise(source)
  File "speech_recognition/__init__.py", line 114, in __enter__
    input = True, # stream is an input stream
  File "build/bdist.linux-armv7l/egg/pyaudio.py", line 750, in open

  File "build/bdist.linux-armv7l/egg/pyaudio.py", line 441, in __init__
    # calling pa.open returns a stream object
IOError: [Errno -9996] Invalid input device (no default output device)
  • Most of those errors can be ignored (when I used pyaudio I got many of the same errors up to the jack server is not running... but my code worked). I believe the error is that pyaudio can't find a microphone to use and so it gives up (see the 'Invalid input device' error). – mkomarinski May 17 '16 at 17:30
  • how can I fix this error??? – happy May 25 '16 at 0:04
  • Make sure the mic is working. Check through the ALSA config to make sure it's recognized. My experience with ALSA is pretty low other than recognizing the errors. – mkomarinski May 26 '16 at 12:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.