python中mp3转wav(Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work")

1、下载pydub:pip install pydub

2、下载与操作系统一致的ffmpeg:http://ffmpeg.org/download.html

3、解压后将下载的ffmpeg下的bin目录路径添加到path的环境变量中

python中mp3转wav(Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work

4、代码如下

1 from pydub import AudioSegment
2 
3 sound = AudioSegment.from_mp3('C:/Users/Desktop/song1.mp3')
4 sound.export('song/song1.wav', format='wav')

 

python中mp3转wav(Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work

 5、ffmpeg报错是因为没下载ffmpeg或下载方式不对或路径没找到或未配置路径等引起的

转载于:https://www.cnblogs.com/ZhangYuniang/p/10632242.html

你可能感兴趣的:(python中mp3转wav(Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work"))