简体   繁体   English

PyAudio OSError:[Errno -9986] 内部 PortAudio 错误

[英]PyAudio OSError: [Errno -9986] Internal PortAudio error

I'm trying to run PyAudio on OSX on a MacBook Air but I keep getting the error:我正在尝试在 MacBook Air 上的 OSX 上运行 PyAudio,但我不断收到错误消息:

||PaMacCore (AUHAL)|| Error on line 1316: err='-66748', msg=Unknown Error
Traceback (most recent call last):
  File "main.py", line 15, in <module>
    stream = p.open(format=p.get_format_from_width(wf.getsampwidth()),
  File "/Users/carlbengtsson/Library/Mobile Documents/com~apple~CloudDocs/stickerapp-ml/sound-detection/venv/lib/python3.8/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/Users/carlbengtsson/Library/Mobile Documents/com~apple~CloudDocs/sound-detection/venv/lib/python3.8/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
OSError: [Errno -9986] Internal PortAudio error

I'm running Python 3.8.2 and have installed PortAudio using brew.我正在运行 Python 3.8.2 并使用 brew 安装了 PortAudio。 Anyone having had this issue before, having any ideas on where to even start debugging this or alternatives for sound recognition?任何人以前遇到过这个问题,对从哪里开始调试这个或声音识别的替代方案有任何想法? Thanks谢谢

I started getting this error as well after upgrading to Big Sur.升级到 Big Sur 后,我也开始收到此错误。

There seems to be an issue with compiling portaudio against macOS SDK 11. Downgrading XCode to 12.1 (which uses macOS SDK 10.5) on Big Sur has reportedly fixed the issue which is currently being tracked here: https://github.com/PortAudio/portaudio/issues/218#issuecomment-731310548 . There seems to be an issue with compiling portaudio against macOS SDK 11. Downgrading XCode to 12.1 (which uses macOS SDK 10.5) on Big Sur has reportedly fixed the issue which is currently being tracked here: https://github.com/PortAudio/ portaudio/issues/218#issuecomment-731310548

Alternatively, now reinstalling from --HEAD seems to work for me.或者,现在从--HEAD重新安装似乎对我有用。

brew uninstall portaudio
brew install portaudio --HEAD

Have you recently updated to BigSur?您最近更新到 BigSur 了吗? I have seen this with another program after the update.更新后,我在另一个程序中看到了这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM