- 2

Question

import speech_recognition as sr r = sr.Rcognizer() with sr.microphone() as source: print('Speak Anything :') audio = r.listen(source) try: text = r.recognize_google(audio) print('You said :{}'.format(text)) except: print('Sorry could not recognize your voice')

21st Nov 2021, 2:35 PM
Shivam s
Shivam s - avatar
2 Answers
+ 3
What exactly does the error message say? Are you trying to run it on sololearn or on your own computer? Also, your code got cut off – don't put it in the heading but ⭐ put it in a script on sololearn playground ⭐
21st Nov 2021, 3:52 PM
Lisa
Lisa - avatar
+ 1
As mentioned, please put it in a script on playground instead of DM or comment. Mention which error you get and if you run it locally or on SL. I am not familiar with the module but maybe someone else here is.
21st Nov 2021, 5:26 PM
Lisa
Lisa - avatar