Downmixing two channels?


#1

Hi all,

quick question… If I have a stereo file which I want to downmix to mono (i.e. mono = left + right), do I need to use two ChannelRemappingAudioSource (ch1->ch1, ch2->ch1) and then mix these two with a MixerAudioSource?

I was hoping the ChannelRemappingAudioSource would do the mixing for me, but it looks like it doesn’t (or am I wrong?)

cheers!

  • bram

#2

Not sure about the ChannelRemappingAudioSource, but you could use an AudioSampleBuffer to do it.


#3

Be aware that simply adding together the channels will not produce correct results unless there is exactly zero correlation between the channels. Since this is presumably a stereo recording, the correlation coefficient will be very high.

Further reading:

http://www.rs-met.com/documents/tutorials/StereoProcessing.pdf


#4

I have a whole chain of various AudioSource processors, so I’d rather keep using them.

No worries guys, I know why I’m downmixing and what the pitfalls are…

  • Bram

#5

FYI the ChannelRemappingAudioSource does the job just nicely.
Just need to set it up as:

channelRemapper.setInputChannelMapping(0, 0);
channelRemapper.setInputChannelMapping(1, 1);
channelRemapper.setOutputChannelMapping(0, 0);
channelRemapper.setOutputChannelMapping(1, 0);

Using two AudioSource’s that feed from one audiosource is definitely not a good idea as they will read consecutively and all weird things start to happen…

  • Bram