From 4866dcc9bda97e8be485fb1f3f8722f9c0436b23 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 2 May 2020 12:02:04 +0200 Subject: [PATCH] fixes --- mac/sound.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mac/sound.cpp b/mac/sound.cpp index 7bca3bdd..4e88b226 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -869,6 +869,7 @@ OSStatus CSound::callbackIO ( AudioDeviceID inDevice, GetSelCHAndAddCH ( iSelInputRightChannel, iNumInChan, iSelCHRight, iSelAddCHRight ); // check size (float32 has four bytes) +// TODO assumption that all buffer have same interleaved number of channels is not correct! // if ( inInputData->mBuffers[0].mDataByteSize * inInputData->mNumberBuffers == // (UInt32) iNumInChan * static_cast ( iCoreAudioBufferSizeMono * 4 ) ) // { @@ -1004,17 +1005,17 @@ OSStatus CSound::callbackIO ( AudioDeviceID inDevice, if ( ( inDevice == pSound->CurrentAudioOutputDeviceID ) && outOutputData ) { // check size (float32 has four bytes) -// if ( inOutputData->mBuffers[0].mDataByteSize * inOutputData->mNumberBuffers == +// if ( outOutputData->mBuffers[0].mDataByteSize * outOutputData->mNumberBuffers == // (UInt32) iNumOutChan * static_cast ( iCoreAudioBufferSizeMono * 4 ) ) // { -// const int iNumChanPerFrame = iNumOutChan / inOutputData->mNumberBuffers; +// const int iNumChanPerFrame = iNumOutChan / outOutputData->mNumberBuffers; // const int iSelBufferLeft = iSelOutputLeftChannel / iNumChanPerFrame; // const int iSelBufferRight = iSelOutputRightChannel / iNumChanPerFrame; // const int iSelInterlChLeft = iSelOutputLeftChannel % iNumChanPerFrame; // const int iSelInterlChRight = iSelOutputRightChannel % iNumChanPerFrame; // -// Float32* pLeftData = static_cast ( inOutputData->mBuffers[iSelBufferLeft].mData ); -// Float32* pRightData = static_cast ( inOutputData->mBuffers[iSelBufferRight].mData ); +// Float32* pLeftData = static_cast ( outOutputData->mBuffers[iSelBufferLeft].mData ); +// Float32* pRightData = static_cast ( outOutputData->mBuffers[iSelBufferRight].mData ); // // // copy output data // for ( int i = 0; i < iCoreAudioBufferSizeMono; i++ )