1

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?

3
  • 4000 seconds is, of course, 1 hour, 6 minutes, and 40 seconds' duration.
    – O. Jones
    Dec 9, 2011 at 2:19
  • Ollie!!! is that you it's me Renrick the crazy Co-op guy from the days of Vivo software, talk about a small world. I just wanted a round number so I chose 4000. Testing out some neuroacoustic audio files created in octave/matlab and sox works great for speed to join them together ;-)
    – Rick T
    Dec 9, 2011 at 3:47
  • Hey Rick, it's me. Nice to see you online! Neuroacoustics sounds like fun.
    – O. Jones
    Dec 9, 2011 at 14:31

1 Answer 1

3
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

2
  • I don't know, perhaps -- I went for what would be easiest to read.
    – sarnold
    Dec 9, 2011 at 4:12
  • another person sent me an email and said another way to do this is by "sox filea.wav fileb.wav hour.wav repeat 1800"
    – Rick T
    Dec 9, 2011 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.