sox

silence out regions of audio based on a list of time stamps , using sox and python

两盒软妹~` 提交于 2019-11-28 06:03:04
问题 I have an audio file. I have a bunch of [start, end] time stamp segments. WHAT I WANT TO ACHIEVE: Say audio is 6:00 minutes long. Segments I have are : [[0.0,4.0], [8.0,12.0], [16.0,20.0], [24.0,28.0]] After I pass these two to sox + python , out put should be audio that is 6 minutes long, but has audio only in the times passed by the segments. i.e I want to pass the time stamps and original audio to SOX + python so that an audio with everything silenced out except for those portions

How can I remove silence from an MP3 programmatically?

扶醉桌前 提交于 2019-11-27 11:14:01
问题 I have MP3 files that sometimes have silence at the end. I would like to remove this silence automatically. From what I can tell, it is "perfect" silence (0 amplitude), not background noise. The length of the content and the silence varies. I found some other questions about cropping to the first 30 seconds or cropping to X and X+N seconds using ffmpeg . I would think I could use a similar approach, as long as I have a way to find when the silence starts. How would I do that programatically?