Steps to reproduce problem (appears to be PC only):
- Join a Zoom or Discord group call, ensure you can hear other people in the call
- Use basic speech recognition code, such as below
- Now can no longer hear other people in the call
Leaving and reentering resolves the issue, as does changing the speaker output after the audio cutout on step 2.
Here is some basic code. Note that at some point I did find this working without cutting the audio on Discord calls, so I'm guessing there's something intermittent on their end -- I'm just trying to figure out how to nicely handle it on my end.
import speech_recognition as sr
r = sr.Recognizer()
m = sr.Microphone()
with m as source:
r.adjust_for_ambient_noise(source)
while(True):
print("Please say something...")
audio = r.listen(source)
command = ""
try:
# All the getting command stuff. 0 is a dummy number
command = r.recognize_google(audio)
print("You said : \n " + command)
if command.lower() == "quit": break
except:
print("Error getting command from microphone")