Search code examples
wavtrimsox

Leave some silence prior to trimming at audio events using sox


I have some audio files that look like this:

enter image description here

I wanted to know if it is possible to delay the trimming process by a specified amount, for example 0.1s, prior to trimming the audio at the end of each silence sections?

The sox command that I use to trim at the end of each silence section is:

for %%i in ("*.wav") do "%_sox%" -V3 "%%~fi" "SilenceTrimBegin-1secclips\%%~ni.wav" silence 1 0.0 -40d trim 0 1 : newfile : restart

Can you assist me in basically leaving some silence before the active audio event? Thanks!


Solution

  • add "pad 0.5 0.5" at the end of the sox recording command to prevent too strict clipping.