ubuntu18.04 | soundfile安装报错与解决

①问题描述

在终端使用pip install soundfile安装soundfile时报错。

②问题解决

python处理音频文件经常要使用soundfile库。ubuntu系统在pip安装soundfile库时报错,是因为缺乏依赖包libsndfile1,所以要先安装依赖包,然后再安装soundfile。命令如下:

  • step1:终端输入sudo apt-get install libsndfile1
  • step2:终端输入pip install soundfile

soundfile学习

点此学习soundfile的使用。

soundfile常用于音频文件读写:

import soundfile as sf

data, samplerate = sf.read('existing_file.wav')
sf.write('new_file.flac', data, samplerate)

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
社会演员多的头像社会演员多普通用户
上一篇 2022年5月19日
下一篇 2022年5月20日

相关推荐