python语音识别设置失败_语音识别python代码无法正常工作

我在安装了pyAudio的

Python 2.7中运行以下代码.

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

输出指示闪烁.而已.请帮助,因为我是新手.

你可能感兴趣的:(python语音识别设置失败)