关于我的代码为什么不接受麦克风输入的任何想法?

时间:2020-03-28 19:41:33

标签: python speech-recognition speech-to-text

每次我运行代码时,它都会在“监听...”时暂停,我不知道为什么。知道为什么会这么做吗?

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')

0 个答案:

没有答案