I am using AVAudioSession to detect whether an external mic is attached to the device I'm using (an iPad 2 in this case). However, the below call is returning nil when I have an external mic attached, and when I don't.
NSArray *availableInputs = [[AVAudioSession sharedInstance] availableInputs];
AVAudioSessionPortDescription *port = [availableInputs objectAtIndex:0];
I would have assumed that when the mic is not attached this would return a list including the internal mic alone, with the external microphone attached it would return a list including the internal mic and the external mic.
This thread indicates that it should be returning these sort of results (with an error in this case, but that seems irrelevant), so I'm confused as to why I'm not getting the correct output. Perhaps there's a flag that needs to be set to show that I'm using multi-route audio.
Any help would be appreciated.