I am trying a python script for speech recognition, i have installed the required pyaudio and SpeechRecognition modules in my enivronment.
The program was running fine till yesterday, but now it is stuck in "say something". Below is my code.
import speech_recognition as sr
print "say something1"
r = sr.Recognizer()
print "say something2"
with sr.Microphone() as source: # use the default microphone as the audio source
print "say something3"
audio = r.listen(source,timeout=3) # listen for the first phrase and extract it into audio data
print "say something"
try:
print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligible
print("Could not understand audio")
Console o/p :-
say something1
say something2
ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
say something3
Not duplicate of/ Have refferd to :- speech recognition python code not working