4

I am researching creating multi-output devices on either OS X or iOS, and I found out that CoreAudio would allow you to create aggregate devices. My first question is, does iOS allow you to do this. I know that this is certainly possible on OS X, but I've heard that iOS will not allow it. I would really appreciate an example of how you would go about detecting multiple audio output devices and creating an aggregate device, all using swift. I have checked here, but it doesn't fully answer my question, and the answer it does have is based on Objective-C. I'd appreciate any help, and thanks in advance!

Community
  • 1
  • 1
Jake3231
  • 703
  • 8
  • 22

1 Answers1

1

The aggregate audio device API is not publicly available on iOS, so you cannot create those devices yourself.

However iOS will create aggregate devices* for you depending on the most recently attached audio hardware and some other rules if you activate an AVAudioSession that uses the .multiRoute category.

When you get a route change notification due to an audio interface being added or removed, you can create a remote IO audio unit with the right number of channels. I haven’t tried using multi route audio with AVAudioEngine nor have I tried using only a subset of the available channels.

* They’re probably aggregate devices, although you never see them or interact with them directly.

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
  • But unfortunately it appears that the multiRoute category does not support bluetooth audio devices? https://developer.apple.com/documentation/avfoundation/avaudiosession/categoryoptions/1616518-allowbluetooth (Seriously, come on Apple) – Winston Du Jul 16 '20 at 03:25
  • oh that really sucks, they work fine on osx aggregate audio devices (apart from the whole aggregate incurring that bluetooth latency) – Rhythmic Fistman Nov 15 '21 at 10:41