因此,我正在试用python中的speechrecognition模块(https://pypi.python.org/pypi/SpeechRecognition/),并尝试以下代码:
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source: # use the default microphone as the audio source
audio = r.listen(source) # listen for the first phrase and extract it into audio data
try:
print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligible
print("Could not understand audio")
运行时,我得到以下错误:
^{pr2}$额外信息:在运行代码后的几秒钟内,代码崩溃并产生错误。在
有人知道是什么导致了这个错误,我该怎么解决它?在
谢谢, 汤姆
目前没有回答
相关问题 更多 >
编程相关推荐