$ brew install ffmpeg
$ brew upgrade ffmpeg
$ echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
$ echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
$ pip3 install pydub
from pydub import AudioSegment
def trans_mp3_to_wav(filepath, out_name):
song = AudioSegment.from_mp3(filepath)
song.export(out_name + ".wav", format="wav")
wav = trans_mp3_to_wav('./tiesto.mp3', 'tiesto')
本作品採用《CC 協議》,轉載必須註明作者和本文連結