pyaudio OSError: [Errno - 9999] Unanticipated host error

让人想犯罪 __ 提交于 2019-12-02 17:52:09

问题


I'm trying to use the microphone of my webcam logitech to listen

with sr.Microphone(sample_rate=32000) as source:
...

This error occurs :

File "/home/pi/project2/interface.py", line 226, in listen with sr.Microphone(sample_rate = 32000) as source: File "/usr/local/lib/python3.4/dist-packages/speech_recognition/init.py", line 140, in enter input=True, # stream is an input stream File "/usr/local/lib/python3.4/dist-packages/PyAudio-0.2.10-py3.4-linux-armv7l.egg/pyaudio.py", line 750, in open stream = Stream(self, *args, **kwargs) File "/usr/local/lib/python3.4/dist-packages/PyAudio-0.2.10-py3.4-linux-armv7l.egg/pyaudio.py", line 441, in init self._stream = pa.open(**arguments) OSError: [Errno -9999] Unanticipated host error

I didn't find any fitting information on the web


回答1:


You may check your anti-virus SW. I got the same problem "OSError: [Errno - 9999] Unanticipated host error" every time I tried to record the wave file by pyAudio. I check and confirm all the parameters OK. I was stuck for several days before I noticed the anti-virus on my PC block my python script call to the hardware level.

All the thing I need to do is disable or exit the anti-virus SW and everything work well again.



来源:https://stackoverflow.com/questions/43841316/pyaudio-oserror-errno-9999-unanticipated-host-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!