Audio Question

What is the simplest juce way to convert a buffer of stereo channels into a new buffer with one mono channel?

processBlock( AudioSampleBuffer &buffer, MidiBuffer &midiMessages)
    if ( isMono )
       AudioSampleBuffer monoBuffer;



Well, not sure about the best way in JUCE. But the general procedure is: Add both stereo channels and divide by two => mono channel.

That is what I am doing for now. I thought juce might have a built-in method.


Not sure what your background is, nor what your case is, but a bit of information; doing what Alatar suggested risks ruining an intended stereo mix. Professional studio mixing engineers tend to have tested and prepared their stereo mix for monophonic playback (ie: movies, music) by using the left channel.

Joel - my understanding is that the usual practise when checking mono compatibility with stereo monitors is to fold down the stereo channels to mono using summing (as described by Alatar) but then listen to the result through only one monitor speaker (left or right, depending on local convention). Is that what you meant?

We have plenty of methods for adding channels and applying a gain. I think it'd be over-specialisation to add something that does stereo-to-mono specifically.