I’m shocked that this function does not already exist:
AudioSourceChannelInfo::AudioSourceChannelInfo (AudioSampleBuffer& otherBuffer)
{
buffer = &otherBuffer;
numSamples = otherBuffer.getNumSamples ();
startSample = 0;
}
Finally, calling code can do away with the AudioSourceChannelInfo structure and work directly in AudioSampleBuffer (which is 99% of use cases).