Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import speech_recognition as sr
  2.  
  3. r=sr.Recognizer()
  4. r.pause_threshold=0.7
  5. r.energy_threshold=400
  6.  
  7. while(1):
  8. with sr.Microphone () as source:
  9. audio=r.listen(source)
  10. message=str(audio)
  11.  
  12. try:
  13. print(r.recognize_google(audio))
  14. except sr.UnknownValueError:
  15. print("We could not understand audio please speak again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement