pyaudio OSError: [Errno - 9999] 意外的主机错误 [英] pyaudio OSError: [Errno - 9999] Unanticipated host error

查看:316
本文介绍了pyaudio OSError: [Errno - 9999] 意外的主机错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用罗技网络摄像头的麦克风收听

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

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

出现这个错误:

文件/home/pi/project2/interface.py",第 226 行,在听以 sr.Microphone(sample_rate = 32000) 作为来源:文件"/usr/local/lib/python3.4/dist-packages/speech_recognition/init.py",第 140 行,输入input=True, # stream 是输入流文件 "/usr/local/lib/python3.4/dist-packages/PyAudio-0.2.10-py3.4-linux-armv7l.egg/pyaudio.py",750线,开放中流 = Stream(self, *args, **kwargs) 文件/usr/local/lib/python3.4/dist-packages/PyAudio-0.2.10-py3.4-linux-armv7l.egg/pyaudio.py",第 441 行,在 init 中self._stream = pa.open(**arguments) OSError: [Errno -9999] 意外的主机错误

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

推荐答案

Windows 用户在这里.对我来说,我只需要更改每次连接耳机时都会更改的默认麦克风.

Windows user here. For me, I just had to change the default microphone which was being changed every time I connected my headphones.

如果没有麦克风访问程序或麦克风工作不正常,也可能会发生这种情况.要检查麦克风是否正常工作,请尝试在录音机中录制一些音频,然后查看所选麦克风是否为默认录音设备.

This might also happen if there is no microphone access to the program or the microphone is not working properly. To check if the microphone is working properly, try recording some audio in voice recorder, and see if the selected microphone is the default audio recording device.

这篇关于pyaudio OSError: [Errno - 9999] 意外的主机错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆