What mathematical formula do video editors use when they create a final mix of audio tracks?

Suppose I have a mono track pcm_f32le and 2 stereo tracks pcm_f64le. How do they calculate the loudness of each track in the output file? I'd like to do the same in numpy.

enter image description here

1 Answer 1


Simply multiply each sample with a factor and then sum it to get the output sample. In the example, if you want to create a new mono signal out:

out(t) = f1 x mono(t) + f2 x left(t) + f3 x right(t)

Where f1, f2 and f3 are the amplification factors, out(t) is output sample at time t.

The factors would typically be less than 1, so the calculations are probably best done using floating point numbers. If necessary there would be a last stage where out(t) is converted from float to whatever format you use on output.

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.