Rick T
Rick T

Reputation: 3389

alternate two wav files into 1 single one using sox and bash

I'm using linux and bash I have two files filea.wav and fileb.wav which are both 1 second long. I would like to join 4000 of them so I will get 1 large file that is an hour long that has the two files alternating.

Example: of what the 1 hour single file would look like filea.wav fileb.wav filea.wav fileb.wav filea.wav fileb.wav .....

I know I can use sox to create and repeat a file

sox filea.wav file1hour.wav repeat 4000

but how can I have it so two files alternate back and forth and still get 1 single file using sox?

Upvotes: 1

Views: 865

Answers (1)

sarnold
sarnold

Reputation: 104040

sox filea.wav fileb.wav long.wav
sox long.wav file1hour.wav repeat 1800
rm long.wav

More details on how to use sox(1): http://sox.sourceforge.net/sox.html

Upvotes: 3

Related Questions