赞
踩
在终端使用pip install soundfile
安装soundfile时报错。
python处理音频文件经常要使用soundfile库。ubuntu系统在pip安装soundfile库时报错,是因为缺乏依赖包
libsndfile1
,所以要先安装依赖包,然后再安装soundfile。命令如下:
sudo apt-get install libsndfile1
pip install soundfile
点此学习soundfile的使用。
soundfile常用于音频文件读写:
import soundfile as sf
data, samplerate = sf.read('existing_file.wav')
sf.write('new_file.flac', data, samplerate)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。