ffmpeg - 如何通过检测无声部分拆分mp3文件?

分享于 

1分钟阅读

ubuntu

  繁體


pydub是为这个目的而开发的(内部使用ffmpeg或libav),它有一个split_on_silence()的函数,有一些设置,例如keep_silence = 100。


# Load your audio.


song = AudioSegment.from_mp3("your_audio.mp3")



chunks = split_on_silence (


 # Use the loaded audio. 


 song, 


 # Specify that a silent chunk must be at least 2 seconds or 2000 ms long.


 min_silence_len = 2000,


 # Consider a chunk silent if it's quieter than -16 dBFS.


 # (You may want to adjust this parameter.)


 silence_thresh = -16


)





文件  PAR  Detect  SPL  MP3  切分  
相关文章