Disable buffer allocation with CoreAudio capture
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user