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
  Raspberry PI - PyAudio - Streaming to Web Page ultimatecodewarrior 2 2,077 Dec-25-2024, 10:54 AM
Last Post: pintailscratchy
  pyaudio seems to randomly halt input. elpidiovaldez5 2 2,275 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  help with PyAudio Leo12143 1 3,748 Jan-18-2021, 09:56 AM
Last Post: DT2000
  pyAudio playing variable Talking2442 3 5,065 Dec-01-2020, 06:20 PM
Last Post: Talking2442
  Pyaudio Souls99 7 6,744 Oct-05-2020, 04:06 PM
Last Post: Larz60+
  PyAudio [Errorno -9999] Unanticipated Host Error iMuny 5 10,468 Sep-21-2020, 06:58 PM
Last Post: jefsummers
  PyAudio Buffer Data Calculation MclarenF1 0 4,152 Aug-21-2020, 10:55 AM
Last Post: MclarenF1
  PyAudio throwing Input overflowed anthares 3 8,428 Jun-14-2020, 03:37 PM
Last Post: anthares
  Using pyaudio to stop recording under certain sound threshold Twanski94 2 11,053 Jun-13-2020, 11:35 AM
Last Post: Twanski94
  update imhow in callback from pyaudio markB 0 4,083 May-28-2020, 06:01 PM
Last Post: markB

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.