from pydub import AudioSegment
from pydub.utils import make_chunks
audio = AudioSegment.from_file("./nnqdzj01.mp3", "mp3")
size = 30000 #切割的毫秒数 10s=10000
chunks = make_chunks(audio, size) #将文件切割为30s一块
for i, chunk in enumerate(chunks):
chunk_name = "./nnqdz01-wav30/nnqdzj00-{0}.wav".format(i)
print(chunk_name)
chunk.export(chunk_name, format="wav")
相关文章
- 12-11pydub 把音频按时间段切成小段