Disable buffer allocation with CoreAudio capture

This commit is contained in:
Chris Robinson
2020-11-24 14:44:13 -08:00
parent a913aa6ba8
commit ba39c622ef
+8
View File
@@ -464,6 +464,14 @@ void CoreAudioCapture::open(const ALCchar *name)
if(err != noErr)
throw al::backend_exception{ALC_INVALID_VALUE, "Could not set capture callback: %u", err};
// Disable buffer allocation for capture
Uint32 flag{0};
err = AudioUnitSetProperty(mAudioUnit, kAudioUnitProperty_ShouldAllocateBuffer,
kAudioUnitScope_Output, 1, &flag, sizeof(flag));
if(err != noErr)
throw al::backend_exception{ALC_INVALID_VALUE,
"Could not disable buffer allocation property: %u", err};
// Initialize the device
err = AudioUnitInitialize(mAudioUnit);
if(err != noErr)