PyAudio不接麦克风

问题描述

PyAudio出现问题。我的麦克风没有接音频,Windows表示python正在使用它。我的终端卡在了“聆听中” ...并且无法接听我的声音。我的麦克风是USB麦克风。

def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
    print("Listening...")
    audio = r.listen(source)

try:
    print("Recognizing...")
    query = r.recognize_google(audio,Language = 'en')
    print(f"user said: {query}\n")
except Exception as e:
        print(e)
        ("Please repeat that")
        query = None
return query

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)