Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge 2 audio files in sox

Tags:

merge

sox

I am trying to merge 2 wave files into one file. The 2 files should start playing at the beginning of the new file. Independently of sound length. Running the following command does not give me this result.

  sox -M new_input.wav myrecording.wav output_test.aiff

Are there other ways of achieving this through sox or other command line libraries?

like image 996
Ellen S Avatar asked Feb 26 '12 20:02

Ellen S


People also ask

Can we merge two audio?

Audio Joiner is a website dedicated to merging audio files online. This means you don't have to download anything to make it work. Just upload the tracks you want combined and then download the single file when you're done.


1 Answers

For cases like Calmarius is asking:

sox -m in1.wav in2.wav out.wav trim 0 `soxi -D in1.wav`

this stops at the length of in1.wav, for cases you know the shorter. Otherwise just add a comparator.

like image 149
Johan Ehnberg Avatar answered Oct 05 '22 12:10

Johan Ehnberg