当前位置:   article > 正文

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

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)
  • 1
  • 2
  • 3
  • 4

在这里插入图片描述

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号