0

Steps to reproduce problem (appears to be PC only):

  1. Join a Zoom or Discord group call, ensure you can hear other people in the call
  2. Use basic speech recognition code, such as below
  3. 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")
Zefyr
  • 13
  • 2
  • Sorry but this is a "Me too" comment, I have just started having the same problem with speech_recognition. Did you find a solution for it in the end, please? – Stuart Bruce Jun 23 '21 at 12:55
  • @StuartBruce nope. It might be a PyAudio issue though, since I have it when working with MuseScore as well (both use PyAudio in the backend). – Zefyr Jul 05 '21 at 19:23

0 Answers0