speech_recognition icon indicating copy to clipboard operation
speech_recognition copied to clipboard

recognizer.listen(source) is not stopping automatically even with "with" statement

Open SaiTeja-555 opened this issue 4 years ago • 2 comments

Steps to reproduce

  1. (How do you make the issue happen? Does it happen every time you try it?)
  2. (Make sure to go into as much detail as needed to reproduce the issue. Posting your code here can help us resolve the problem much faster!)
  3. (If there are any files, like audio recordings, don't forget to include them.)

Expected behaviour

it should print both listening... and processing...

(What did you expect to happen?)

Actual behaviour Screenshot from 2020-10-04 23-40-23 Screenshot from 2020-10-04 23-40-33


(What happened instead? How is it different from what you expected?)

(If the library threw an exception, paste the full stack trace here)

System information

(Delete all the statements that don't apply.)

My system is Ubuntu 20.04.1 LTS

My Python version is python 3.8.2. (You can check this by running python -V.)

My Pip version is pip 20.0.2. (You can check this by running pip -V.)

My SpeechRecognition library version is 3.8.1. (You can check this by running python -c "import speech_recognition as sr;print(sr.__version__)".)

My PyAudio library version is 0.2.11. (You can check this by running python -c "import pyaudio as p;print(p.__version__)".)

My microphones are: [ 'HDA ATI HDMI: 0 (hw:0,3)', 'hdmi', 'jack', 'pulse', 'default'] (You can check this by running python -c "import speech_recognition as sr;print(sr.Microphone.list_microphone_names())".)

My working microphones are: given cmd is not working(You can check this by running python -c "import speech_recognition as sr;print(sr.Microphone.list_working_microphones())".)

I installed PocketSphinx from <INSERT SOURCE HERE>. (For example, from the Debian repositories, from Homebrew, or from the source code.)

SaiTeja-555 avatar Oct 04 '20 18:10 SaiTeja-555

I am a user, i was having a very similar issue on mac i found that the problem was that my code did not have the necessary permissions to access the microphone. I hope this might help you to understand better your problem. ~RP

Vricken avatar Oct 27 '20 20:10 Vricken

The problem here is you are not calling a recognizer, please see the microphone examples for an example. As an example, if you wanted to use sphinx: r.recognize_sphinx(audio) would be what you would call to get recognition.

GhostDog98 avatar Sep 12 '21 00:09 GhostDog98