0%

如何使用python将.mp3转换为.wav?

✔️ 使用python3,代码如下:

1
2
3
from pydub import AudioSegment
sound = AudioSegment.from_mp3("test.mp3")
sound.export("test.wav", format="wav")

安装pydub:

1
2
3
4
5
6
7
8
pip3 install pydub

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get install ffmpeg

python3 convert.py