PyAudioOSError:[Errno-9986]内部PortAudio错误

我正在尝试在 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

我正在运行 Python 3.8.2 并使用 brew 安装了 PortAudio。任何人以前遇到过这个问题,对从哪里开始调试这个问题或声音识别的替代方案有任何想法吗?谢谢

回答

升级到 Big Sur 后,我也开始收到此错误。

针对 macOS SDK 11 编译 portaudio 似乎存在问题。据报道,在 Big Sur 上将 XCode 降级到 12.1(使用 macOS SDK 10.5)已解决了当前正在此处跟踪的问题:https : //github.com/PortAudio/ portaudio/issues/218#issuecomment-731310548。

或者,现在重新安装--HEAD似乎对我有用。

brew uninstall portaudio
brew install portaudio --HEAD

  • This solved the problem for me, huge thanks!

以上是PyAudioOSError:[Errno-9986]内部PortAudio错误的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>