简便的音频文件操作:pyDub
jopen
10年前
通过简单和容易的高级别接口来操作音频文件。
Open a WAV file
from pydub import AudioSegment song = AudioSegment.from_wav("never_gonna_give_you_up.wav")
...or a mp3
song = AudioSegment.from_mp3("never_gonna_give_you_up.mp3")
... or an ogg, or flv, or anything else ffmpeg supports
ogg_version = AudioSegment.from_ogg("never_gonna_give_you_up.ogg") flv_version = AudioSegment.from_flv("never_gonna_give_you_up.flv") mp4_version = AudioSegment.from_file("never_gonna_give_you_up.mp4", "mp4") wma_version = AudioSegment.from_file("never_gonna_give_you_up.wma", "wma") aac_version = AudioSegment.from_file("never_gonna_give_you_up.aiff", "aac")