0

I want to recognize the sound that is playing on my computer. What should I do?

import speech_recognition
import pyaudio
from speech_recognition import *
import os

r = Recognizer()
m = Microphone()


with m as source:
            print('start recognize')
            audio = r.listen(source)
            try:
                Text = r.recognize_google(audio)
                print(Text)
            except:
                print('error')
  • 1
    Does your code work? If not what's the issue? – user202729 Oct 04 '21 at 08:13
  • If the issue is you cant capture speaker output this is OS dependant and there are answers here https://stackoverflow.com/questions/26573556/record-speakers-output-with-pyaudio – SamBob Oct 04 '21 at 08:14
  • 1
    I want to recognize the audio that is being played on my computer, not by the microphone. – SilverPage Oct 05 '21 at 00:53
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 09 '21 at 08:35

0 Answers0