I got a more general question on mixing audio. Let’s say I have 2 (or 3 or 10) audiochannels and need to downmix them to one – how would I do that? E.g. I can’t simply add all up and take the average. E.g. for 2 chennels a quite bad idea is:
(Channel1+Channel2) / 2
because if Channel 1 / 2 is silent I get the other chan just the have as loud. If both channels are playing exactly the same sound – okay – I end up with a correct result.
How can I mix channels? I guess there must be an easy solution – but I can’t find any :-(((
Desperately seaching – please help!
PS: A short implementation (algo) would also be appreciated.
- Anonymous asked 15 years ago
1st. sound and sonic are additive.
2nd. Paul, you could try to code a compressor or use an existing one. A compressor lowers the volume only if a samplevalue comes over a defined treshhold-value (f.e. -20 dB) and lowers it relative, e.g. with the reduction-factor of 2. (Theres are also attack and decay times, and sometimes some more values to change) So the loudest part now is not as loud as before and you can increase the mainvolume.
A compressor with a gain-reduction above factor 20 is called Limiter.
So they both prevent clipping, give a warm & fat sound (sometimes toooooo fat, then you’ll hear it working) and steal dynamicrange, so all parts sounds more or less equal loud.
I don’t know, why I’m telling you this, but perhaps you are intersted in …
You only have to code a compressor, best would be a multiband-compressor. But a good sounding one steals CPU.
But I guess this is not a good solution for me – since if you play a very loud (maximised) sound multiple times it gets too-loud / distorted. What I want it the sound to remain the same (maximum) volume as it did before. Like mixing with an analog mixing panel in “real world”. Is there no way around it? How does Fmod handle such cases? For sure I could do some testing with CoolEdit etc. but that’s hard work – to find an algo :-((
Anybody else got a suggestion?
- Anonymous answered 15 years ago
Please login first to submit.