AudioTransportSource::getNextAudioBlock() reading 8 channel file yields a buffer with only 6 channels


#41

The AudioAppComponent getNextAudioBlock implementation I wrote so far and which appears to work :

void MainComponent::getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill)
{
    bufferToFill.clearActiveBufferRegion();
	AudioSourceChannelInfo workBufferInfo(&workBuffer, bufferToFill.startSample, bufferToFill.numSamples);
	transportSource.getNextAudioBlock(workBufferInfo);
	AudioBuffer<float> procBuf(workBuffer.getArrayOfWritePointers(),
		readerSource->getAudioFormatReader()->numChannels,
		bufferToFill.startSample,
		bufferToFill.numSamples);
	MidiBuffer midi;
	processBlock(procBuf, midi);
	// copy the stereo audio into the final output
	for (int i = 0; i < 2; ++i) 
		bufferToFill.buffer->copyFrom(i, bufferToFill.startSample, workBuffer, 
			i, bufferToFill.startSample, bufferToFill.numSamples);
}

Note the final audio copy step which is needed because the code before that is not manipulating the bufferToFill buffer except by clearing it at the beginning.