mindeasechatbot / voicetotext.py
venkataseetharam's picture
Upload 10 files
3a6775a verified
raw
history blame
374 Bytes
import speech_recognition as sr
r = sr.Recognizer()
def listen():
with sr.Microphone() as source:
print("Talk")
audio_text = r.listen(source)
print("Time over, thanks")
try:
print("Text: "+r.recognize_google(audio_text))
except:
print("Sorry, I did not get that")
return r.recognize_google(audio_text)