Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen_in_background is not calling the callback at all #692

Open
ObadaZay opened this issue Jun 1, 2023 · 1 comment
Open

listen_in_background is not calling the callback at all #692

ObadaZay opened this issue Jun 1, 2023 · 1 comment

Comments

@ObadaZay
Copy link

ObadaZay commented Jun 1, 2023

I was trying the background_listening.py example, but it doesn't give any output, it doesn't even call the callback function, I've tried Python 3.11, Python 3.8 and python 3.9 and tried different microphones with making sure I have the correct index inside m = sr.Microphone() but doesn't seem to work and I don't get any error, and the normal microphone example works fine but because i need to stop it on request without a specific duration I need to use background listening

Edit: Sometimes it works, most of times it doesn't, can't know what happens although no change in code or libraries

Steps to reproduce

  1. pip install speechRecognition==3.10.0 and pip install PyAudio==0.2.13
  2. Run the background_listening.py example

Expected behaviour

It should give normal output (the spoken words, error (Google Speech Recognition could not understand audio, Could not request results from Google Speech Recognition service)).

Actual behaviour

No output at all, after tracing the callback is not being called at all.

System information

My system is <Windows 11>.

My Python version is <3.8, 3.9, 3.11>.

My Pip version is <22.3.1, 23.1.2>.

My SpeechRecognition library version is <3.10.0>.

My PyAudio library version is <0.2.13>

My microphones are:
[
"Microsoft Sound Mapper - Input",
"Microphone (Realtek(R) Audio)",
"Microsoft Sound Mapper - Output",
"Speakers (Realtek(R) Audio)",
"Primary Sound Capture Driver",
"Microphone (Realtek(R) Audio)",
"Primary Sound Driver",
"Speakers (Realtek(R) Audio)",
"Speakers (Realtek(R) Audio)",
"Microphone (Realtek(R) Audio)",
]

My working microphones are: {0: 'Microsoft Sound Mapper - Input', 1: 'Microphone (Realtek(R) Audio)', 4: 'Primary Sound Capture Driver', 5: 'Microphone (Realtek(R) Audio)', 9: 'Microphone (Realtek(R) Audio)'}

@alexiri
Copy link

alexiri commented Sep 2, 2023

I have the same issue, the background_listening.py example doesn't seem to work at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants