3

I'm trying to add background audio to a primary wav file.

sox -m primary.wav background.wav output.wav 

I have about 5s of background chatter in background.wav and I'd like the output to always be at the length of primary. How can I make sox loop and trim background.wav to the length of primary for mixing in shell?

codekitty
  • 133

1 Answers1

2

ffmpeg does it very well. For example:

ffmpeg -i input1.mp3 -i input2.mp3 -filter_complex amerge -ac 2 -c:a libmp3lame -q:a 4 output.mp3

See the FFmpeg manual for Manipulating audio channels

cmak.fr
  • 8,976