Python Forum
Not getting response from pyaudio
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not getting response from pyaudio
#1
I am not able to communicate using the laptop microphone

Here is my code
import smtplib # Simple Mail Transfer Protocol
import pyaudio
import speech_recognition as sr  # Speech Recognition
listener = sr.Recognizer()

with sr.Microphone() as source:
        print('listening.......')
        voice = listener.listen(source)
        info = listener.recognize_google(voice)
        print(info)
Here is the error


Error:
Traceback (most recent call last): File "h:\CODE\Py_EmailBot\Email_Bot.py", line 11, in <module> with sr.Microphone() as source: File "C:\Users\Python\AppData\Local\Programs\Python\Python39\lib\site-packages\speech_recognition\__init__.py", line 138, in __enter__ self.audio.open( File "C:\Users\Python\AppData\Local\Programs\Python\Python39\lib\site-packages\pyaudio.py", line 750, in open stream = Stream(self, *args, **kwargs) File "C:\Users\Python\AppData\Local\Programs\Python\Python39\lib\site-packages\pyaudio.py", line 441, in __init__ self._stream = pa.open(**arguments) OSError: [Errno -9999] Unanticipated host error
I am using a Lenovo Thinkpad T440S
Yoriz write Jul-01-2021, 06:07 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
I got to know that i needed to "Allow apps to access your microphone" set to ON windows 10 Microphone privacy settings.

Resolved
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyaudio seems to randomly halt input. elpidiovaldez5 2 362 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  help with PyAudio Leo12143 1 1,935 Jan-18-2021, 09:56 AM
Last Post: DT2000
  pyAudio playing variable Talking2442 3 3,020 Dec-01-2020, 06:20 PM
Last Post: Talking2442
  Pyaudio Souls99 7 3,550 Oct-05-2020, 04:06 PM
Last Post: Larz60+
  PyAudio [Errorno -9999] Unanticipated Host Error iMuny 5 5,634 Sep-21-2020, 06:58 PM
Last Post: jefsummers
  PyAudio Buffer Data Calculation MclarenF1 0 2,128 Aug-21-2020, 10:55 AM
Last Post: MclarenF1
  PyAudio throwing Input overflowed anthares 3 4,758 Jun-14-2020, 03:37 PM
Last Post: anthares
  Using pyaudio to stop recording under certain sound threshold Twanski94 2 6,429 Jun-13-2020, 11:35 AM
Last Post: Twanski94
  update imhow in callback from pyaudio markB 0 2,340 May-28-2020, 06:01 PM
Last Post: markB
  When piping a FFMPEG stream to PyAudio, I get a "click" on every loop klehman 0 4,824 Dec-15-2019, 04:22 AM
Last Post: klehman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020