常规的安装:
pip install pyaudio
可能会报错:
Failed to build pyaudio
ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects
先按照一些必要的库
sudo apt-get install libasound2-dev
先到官网http://files.portaudio.com/download.html下载PortAudio:
把下载好的文件pa_stable_v190700_20210406.tgz
放到ubuntu系统桌面上的一个文件夹中,比如我的learn\ruanjian
.
然后解压:
tar -xvf pa_stable_v190700_20210406.tgz
接着进入portaudio
目录:
cd porta