解决办法
在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 !