Open estella144 opened 2 years ago
Hello,
I'm having the same problem. Just running the example with microphone and it stalls and does nothing. But, running the example with wav file it runs without problems. So I guess its related to the microphone stream.
How long does the listen method listens to? It is a stream? When does it starts to convert to text? It is not clear from the example...
Any help please? Thank you.
Hey you all! Same problem here. PyAudio's recording feature seems to breakdown after a few uses, in my case.
Hey you all! Same problem here. PyAudio's recording feature seems to breakdown after a few uses, in my case.
Did you figure out any fix for that?
I am currently testing it as well and have the same issue, it can maybe figure out my hello once or twice and then proceeds to just not do anything.
I paused the project quite a while ago, but IIRC my next steps were to use an alternate library to record audio, then write the data to a file and convert it to FLAC formatting, before using the SpeechRecognizer recognize function to get the text.
Alternatively, you could record audio and write to an array, outputting the data to a file whenever noise drops below x threshold, and send that for recognition. This process would basically replicate what pre-existing libraries have already done though. PyAudio seems to just be janky.
Hello, I had this problem too. Please check if you are using the default microphone. I was connected to my Oculos microphone by default for some reason 🤷
That could work, but the issue is that it works for a few times before crashing. So the correct microphone should be being recognized.
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Steps to reproduce
This code does not get past getting audio from the microphone: `import speech_recognition as sr
r = sr.Recognizer() m = sr.Microphone()
try: print("A moment of silence, please...") with m as source: r.adjust_for_ambient_noise(source) print("Set minimum energy threshold to {}".format(r.energy_threshold)) while True: print("Say something!") with m as source: audio = r.listen(source) print("Got it! Now to recognize it...") try:
recognize speech using Google Speech Recognition
except KeyboardInterrupt: pass`
Expected behavior
Should advance to recognition:
value = r.recognize_google(audio)
Actual behavior
with m as source: audio = r.listen(source)
, even after speaking, does not advance to the next line.System information
My system is macOS Monterey version 12.0.1 (21A559).
My Python version is Python 3.10.1.
My Pip version is pip 21.3.1 from /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip (python 3.10).
My SpeechRecognition library version is 3.8.1.
My PyAudio library version is 0.2.11
My microphones are: ['MacBook Air Microphone', 'MacBook Air Speakers', 'ZoomAudioDevice'].
My working microphones are: Function does not work
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object 'Microphone' has no attribute 'list_working_microphones'