Advertisement
sarkite

Untitled

Nov 5th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 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. try:
  6. print(r.recognize(audio)) # recognize speech using Google Speech Recognition
  7. except LookupError: # speech is unintelligible
  8. print("Could not understand audio")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement