I do not know why there was no simple property availableOutputs .
But you can get a list of all available outputs using the multi-pass audio category and check your current route outputs:
let sesh = AVAudioSession() try! sesh.setCategory(AVAudioSessionCategoryMultiRoute) try! sesh.setActive(true) print("available outputs: \(sesh.currentRoute.outputs)\n")
Exits (and inputs) come and go, causing changes in the route, so sign up for a notification of a change in the route:
NSNotificationCenter.defaultCenter().addObserver( self, selector: "routeChanged:", name: AVAudioSessionRouteChangeNotification, object:nil )
NB : in the multi-route category, there are a lot of rules about when the inputs / outputs that are available on an intuitive level are actually available (for example, the speaker is not available "if you have a USB sound card installed, but wired headphones will be) .
What are you trying to do? I used a multi-pass channel to play 4-channel audio, but I'm not sure if you can actually mix and match the outputs.
source share