Created
April 26, 2018 09:44
-
-
Save rfistman/1c63315d6634112eac8b1f7dc9dffe64 to your computer and use it in GitHub Desktop.
trying to figure out if the two iPhone 7 speakers are addressable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError *error = nil; | |
if (![[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryMultiRoute error: &error]) { | |
NSLog(@"setCategory: %@", error); | |
} | |
if (![[AVAudioSession sharedInstance] setActive: YES error: &error]) { | |
NSLog(@"setActive: %@", error); | |
} | |
NSArray<AVAudioSessionPortDescription *> *outputs = AVAudioSession.sharedInstance.currentRoute.outputs; | |
for (AVAudioSessionPortDescription *portDesc in outputs) { | |
NSLog(@"-----"); | |
NSLog(@"UID %@", portDesc.UID); | |
NSLog(@"portName %@", portDesc.portName); | |
NSLog(@"portType %@", portDesc.portType); | |
NSLog(@"channels %@", portDesc.channels); | |
NSLog(@"dataSources %@", portDesc.dataSources); | |
NSLog(@"selectedDataSource %@", portDesc.selectedDataSource); | |
NSLog(@"preferredDataSource %@", portDesc.preferredDataSource); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment