Python SpeechRecognition正在运行,但未通过麦克风收听

Python SpeechRecognition正在运行,但未通过麦克风收听,python,speech-recognition,pyaudio,Python,Speech Recognition,Pyaudio,所以我尝试使用python SpeechRecognition 1.1.3,但它无法通过麦克风识别我。我已经安装了pyAudio,当我运行SpeechRecognition提供的示例代码时,一切似乎都很顺利: # NOTE: this requires PyAudio because it uses the Microphone class import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as so

所以我尝试使用python SpeechRecognition 1.1.3,但它无法通过麦克风识别我。我已经安装了pyAudio,当我运行SpeechRecognition提供的示例代码时,一切似乎都很顺利:

# NOTE: this requires PyAudio because it uses the Microphone class
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")
它只是坐在那里等待麦克风的输入。麦克风工作正常,SpeechRecognition能够识别出它是默认的麦克风,因为当我拔下它时,代码会发出条形码。有什么建议吗


我正在运行Python2.7.6,我的操作系统是Windows7。此外,我把所有这些都放在E:drive上,只是为了让生活变得更复杂一点/

根据脚本,Pyaudio尚未安装。别担心,这是应用程序可能收到的常见语法错误。我建议您做的是,您必须将Python程序重新安装到能够在Pyaudio 1.1.3下运行的版本。您尚未指定您使用的Python版本以及您的计算机运行的操作系统(即Windows Vista 7或8)。假设您可能正在使用Windows 8或7,则必须在Windows cmd中键入easy_install。但是,如果这不起作用,请安装以下Python脚本:
http://peak.telecommunity.com/dist/ez_setup.py
然后从
C:\\Scripts\
键入easy\u install重新尝试该过程。希望这有帮助

我也遇到过类似的问题,然后我意识到这是互联网连接问题。检查宽带连接速度或通过蜂窝网络连接进行测试。

是否检查了麦克风是否静音?麦克风未静音。我检查了我的录音设备,看到它在我说话时都有反应。