每次我运行代码时,它都会在“监听...”时暂停,我不知道为什么。知道为什么会这么做吗?
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print('Listening...')
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print('You said : {}'.format(text) )
except:
print('Sorry i did not catch that')