from
pydub
import
AudioSegment
song
=
AudioSegment.from_mp3(
"song.mp3"
)
extract
song[
20
*
1000
:
30
]
#提取20到30秒
extract.export(
"extract.mp3"
,
format
"mp3"