当前位置: 代码迷 >> 综合 >> pyaudio 内存溢出:OSError: [Errno -9981] Input overflowed
  详细解决方案

pyaudio 内存溢出:OSError: [Errno -9981] Input overflowed

热度:75   发布时间:2024-02-25 07:37:02.0

在read函数中添加exception_on_overflow=False
read()函数中默认为True
如提示找不到参数,请先升级pyaudio
(原是官方的pyaudio旧版本中的一个BUG)
解决办法:先卸载:sudo apt-get remove python3-pyaudio
安装最新版:sudo pip3 install pyaudio
出现错误:
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1
解决办法:安装相关的依赖:sudo apt-get install portaudio19-dev
重新安装
enjoy it !

  相关解决方案