Failure of AudioUnitSetProperty when using MacCatalyst (works on macOS)

I was trying to set custom audio output device for a generated audio on macCatalyst.

While using let status = AudioUnitSetProperty(outputUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &outputDeviceID, UInt32(MemoryLayout.size))

kAudioOutputUnitProperty_CurrentDevice is invalid, and status = -10879, indicating an error.

STEPS TO REPRODUCE

  1. Set Run Destination to MacOS and run the program. "AudioUnitSetProperty: 0" should be printed, indicating it works fine.
  2. Set Run Destination to Mac Catalyst and run the program. "Error setting output device: -10879" should be printed, indicating an error.

Hello @ha0ch3n, thank you for your post. Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a sysdiagnose, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Sure! I just opened a bug report FB16034376.

Failure of AudioUnitSetProperty when using MacCatalyst (works on macOS)
 
 
Q