|
|
@@ -682,15 +682,20 @@ private: |
|
|
|
UInt32 framesPerSlice;
|
|
|
|
UInt32 dataSize = sizeof (framesPerSlice);
|
|
|
|
|
|
|
|
if (AudioUnitSetProperty (audioUnit, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, &actualBufferSize, sizeof (actualBufferSize)) == noErr
|
|
|
|
&& AudioUnitGetProperty (audioUnit, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, &framesPerSlice, &dataSize) == noErr
|
|
|
|
&& dataSize == sizeof (framesPerSlice) && static_cast<int> (framesPerSlice) != actualBufferSize)
|
|
|
|
AudioUnitInitialize (audioUnit);
|
|
|
|
|
|
|
|
AudioUnitSetProperty (audioUnit, kAudioUnitProperty_MaximumFramesPerSlice,
|
|
|
|
kAudioUnitScope_Global, 0, &actualBufferSize, sizeof (actualBufferSize));
|
|
|
|
|
|
|
|
|
|
|
|
if (AudioUnitGetProperty (audioUnit, kAudioUnitProperty_MaximumFramesPerSlice,
|
|
|
|
kAudioUnitScope_Global, 0, &framesPerSlice, &dataSize) == noErr
|
|
|
|
&& dataSize == sizeof (framesPerSlice) && static_cast<int> (framesPerSlice) != actualBufferSize)
|
|
|
|
{
|
|
|
|
actualBufferSize = static_cast<int> (framesPerSlice);
|
|
|
|
prepareFloatBuffers (actualBufferSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
AudioUnitInitialize (audioUnit);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|