9

I love how sox has the ability to split an audio file on silence. The issue I'm haivng is that occasionally my audio tracks end with fadeouts, or notes decaying into reverb (subtle sounds that sox will mistake for silence). I'm trying to adjust the sox command to split the tracks on silence, but LEAVE a LITTLE silence after each split. I can't figure out exactly how to do it. here's the command I have so far:

sox in.wav out.wav silence 1 2 0.5% 1 4.0 0.9% : newfile : restart

Any help with this would be greatly appreciated!

pepper
  • 336
  • 1
  • 3
  • 12
  • sox is GPL and included in distros, why it is not unix-specific? –  Jun 30 '14 at 21:34
  • Because you can install sox on windows systems, and is really unrelated to unix itself. It is software that happens to run on unix, as well as other operating systems. – pepper Jul 02 '14 at 18:46
  • OK, got it. However if you say this, then Sox will be also not Windows specific, because you can install Sox on Un*x systems, right? Cygwin is a Un*x like platform for Windows but has with Windows very little in common (except for developers). There is also a GTK+ widgets port for Windows, but many developers tend to have their software platform independent. I'd say this is the right place for Sox. –  Jul 02 '14 at 20:04
  • stackoverflow i think is about programming , but sox is a utility programme , i guess we better move it to superuser . – 把友情留在无盐 Jan 29 '15 at 11:20
  • 1
    @soubunmei this is completely on topic here. As long as something runs on *nix, it is welcome here. Whether it runs on other platforms as well is irrelevant. In any case, this question is too old to migrate ([the limit is 60 days](http://meta.stackexchange.com/q/151890/203101)). – terdon Jan 29 '15 at 12:55

1 Answers1

1

To add some silence, you need a chunk of silence and append it to your file

sox -n -r 44100 -c 2 silence.wav trim 0.0 3.0

and

sox filetopad.mp3 silence.wav output.wav

as described Padding an audio file with silence using sox.

  • This is not quite the question though. Sox looks for silence based on a volume factor. In music you'll often have an instance of decay, subtle echo, overtones heard after a note has been played. If those are too quiet, or there is other noise on the recording, it's impossible to get sox to not trim those musical moments off. In the end, I found my answer using perl, not sox, thus the request for stack overflow migration. – pepper Jul 02 '14 at 18:40
  • @pepper , do you mind posting your perl solution here ( maybe after editing the title of question non-sox-specific ) ? – 把友情留在无盐 Jan 29 '15 at 11:23