I have installed speech recognition module along with pyaudio on my Python 2.7 in windows. When I execute the python script it executes with no error but the program remains still to listen from the user but does not give any response, i.e., the program does not "listen". Hope you guys can help me out here! (A newbie!)
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source: # use the default microphone as the audio source
audio = r.listen(source) # listen for the first phrase and extract it into audio data
try:
print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligible
print("Could not understand audio")
audio = r.listen(source, timeout=10)
?