I get error -9999 on the following line:
with sr.Microphone() as source:
The confusing part is that this worked for several days without changing anything and now this happens
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)
Thanks for the help, I can't even imagine whats causing this.