Guest User

Untitled

a guest
Mar 30th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import speech_recognition as sr
  2. r = sr.Recognizer()
  3. with sr.Microphone() as source: # use the default microphone as the audio source
  4. audio = r.listen(source) # listen for the first phrase and extract it into audio data
  5.  
  6. try:
  7. print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
  8. except LookupError: # speech is unintelligible
  9. print("Could not understand audio")
Add Comment
Please, Sign In to add comment