I wrote a library designed to do that =D
from pydub import AudioSegment
AudioSegment.from_file("/input/file").export("/output/file", format="mp3")
Easy!
to specify a bitrate, just use the bitrate
kwarg…
from pydub import AudioSegment
sound = AudioSegment.from_file("/input/file")
sound.export("/output/file", format="mp3", bitrate="128k")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…