在以下行上出现错误-9999:
以sr.Microphone()作为来源:
令人困惑的部分是,这种方法已经工作了好几天却没有改变任何东西,现在这种情况发生了。
r.dynamic_energy_threshold = False
r.energy_threshold = 250
print((r.energy_threshold))
try:
with sr.Microphone() as source:
try:
print("waiting for mic3")
audio = r.listen(source, timeout = 0.1)
print(audio)
print("waiting for mic4")
if audio != "":
gaudio = "11&%&" + r.recognize_google(audio)
print("waiting for mic5")
co = 1
print(co)
print(gaudio)
s.sendall(gaudio.encode("utf-8"))
except Exception as e:
co = 0
print(e)
except Exception as e:
co = 0
print(e)
感谢您的帮助,我什至无法想象是什么原因造成的。