Search code examples
iosaudioios6avaudiosession

Available Input/output AVAudioSession data sources in iOS


I am using AVAudioSession and remote IO with the aim of record some info throught both the audio jack connector and the built-in mic... I guess it could be possible with the new feature of iOS 6: Multiroute audio.

In order to do that I would like to get the inputDataSources from my audio session: (https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html#//apple_ref/c/data/AVAudioSessionCategoryMultiRoute)

What I am doing is:

AVAudioSession *session = [AVAudioSession sharedInstance];
NSArray *available_outputs = [session inputDataSources];

(I am also configuring the audio session and activating it)

What I get is all zeros in available_outputs...

What am I doing wrong?


Solution

  • Found it.
    From the documentation:

    This currently only applies to certain USB devices.

    This API is going to change in iOS 7, but 6 is limited to that obscure definition of "certain USB devices".
    BTW, from my tests - it worked on iOS 6.02 for the iPhone microphone but not on 6.1.4 (both tests on iPhone 5).