My goal is to get the parts of audio file that contains non-noise sounds by using SoX. I have read the effects of SoX and found noisered
and silence
which I consider helpful. The problem is that I have not found command that can trim the audio file based on the silent pauses in it.
I believe that what you are looking for can be achieved with a sox silence
command. It allows you to remove the silence from any part of the audio given a threshold, durations above it, etc.
For a detailed manual please refer to the sox webpage, the silence section is very well written.
If you want to split at silence and not to "squeeze" everything together, then you might want to try something like:
sox input.wav slice.wav silence 1 1.0 2% 1 3.0 2% : newfile : restart
Parameters are:
input.wav
- input audio file
slice.wav
- output audio files name (numbers will be appended to each slice)
silence
- effect name
1 1.0 2%
- above_periods, duration, threshold
1 3.0 2%
- below_periods, duration, threshold