Mahdi
Mahdi

Reputation: 724

Merging two audio files with sox while adjusting their volume

Merging two audio files can be done with sox:

sox -m input1.wav input2.wav output.wav

How adjusting the volume of one the input files can be applied in this single command. It is obvious that this can be accomplished by two command like these:

sox -v 0.7 input.wav output.wav
sox -m input1.wav output.wav output2.wav

Upvotes: 0

Views: 1025

Answers (1)

AkselA
AkselA

Reputation: 8856

You're almost there. The -v option can be applied to each input file, and for any of the combine methods. Set the scale factor in front of the file you want it applied to.

sox -n -r 44100 -b 16 s660.wav synth 20 sine 660 # a pure A
sox -n -r 44100 -b 16 s440.wav synth 20 sine 440 # a pure E

sox -m -v 0.4 s440.wav -v 0.9 s660.wav mix4-9.wav # an A5 with weight on the prime
sox -m -v 0.9 s440.wav -v 0.4 s660.wav mix9-4.wav # an A5 with weight on the fifth

Upvotes: 1

Related Questions