Fill all buffers for CoreAudio playback

This commit is contained in:
Chris Robinson 2020-11-24 14:47:04 -08:00
parent ba39c622ef
commit f16692ecf8

View File

@ -85,8 +85,12 @@ CoreAudioPlayback::~CoreAudioPlayback()
OSStatus CoreAudioPlayback::MixerProc(AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32,
UInt32, AudioBufferList *ioData) noexcept
{
mDevice->renderSamples(ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize/mFrameSize,
ioData->mBuffers[0].mNumberChannels);
for(size_t i{0};i < ioData->mNumberBuffers;++i)
{
auto &buffer = ioData->mBuffers[i];
mDevice->renderSamples(buffer.mData, buffer.mDataByteSize/mFrameSize,
buffer.mNumberChannels);
}
return noErr;
}