[program-l] Python:error in Microphone() class

  • From: "Rejin Jose k." <m2rejin@xxxxxxxxx>
  • To: program-l <program-l@xxxxxxxxxxxxx>
  • Date: Wed, 1 Apr 2015 17:45:19 +0530

hello experts,
when I was testing the speech_recognition library in my Ubuntu 14.04
machine with the following example code,i stuck with an error code and
error is given below. please help me to fix it. I'm not much
experienced on Linux platform,so please guide me step by step.

Python script:

import pyaudio
import speech_recognition as sr
r=sr.Recognizer()
with sr.Microphone() as source:
audio=r.listen(source)
try:
print("You said " + r.recognize(audio))
except LookupError: # speech is unintelligible
print("Could not understand audio")

Errors:

ALSA lib pcm dmix.c:1822:(sndpcmdmixopen) unable to open slave
ALSA lib pcm.c:2239:(snd pcm open noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(sndpcmopen noupdate) Unknown PCM cards.pcm.cente
ALSA lib pcm.c:2239:(snd pcm open noupdate) Unknown PCM cards.pcm.side
bt audio service open: connect!) failed: Connection refused (111)
btaudioservice open: connect!) failed: Connection refused (111)
btaudioservice open: connect!) failed: Connection refused (111)
btaudioservice open: connect!) failed: Connection refused (ill)
ALSA lib pcm dmix.c:1022:(sndpcmdmixopen) unable to open slave
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

please help

Thanks and regards
Rejin
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: