For an app, we have a requirement to record from two different audio sources. One mic is a special (throat) mic and it comes with the same connector that the iPhone headset with mic uses.
On a second channel, we would like to record the ambient sounds and the best thing would be if we could just record from the iPhone's/iPad's built-in mic at the same time as we record from the throat mic headset.
Is there any way this is possible? Any other tips?
I have found some FAQ on Apple library about how to choose data source from different microphone port, maybe these will be helpful:
https://developer.apple.com/library/ios/qa/qa1799/_index.html
Listing 1 demonstrates how applications can find the AVAudioSessionPortDescription that represents the built-in microphone, locate the front microphone (on iPhone 5 or another device that has a front facing microphone), set the front microphone as the preferred data source and set the built-in microphone port as the preferred input.
Listing 1 Demonstrate Input Selection.
Listing 1 will produce the following console output when run on an iPhone 5:
UPDATE 14 Nov
Use the code in the front I can set the specific built-in mic on iPhone to record sound, now I’m trying to change the specific mic on iPhone frequently to simulate a stereo record.
The OS currently only allows an app to connect to one audio source route at a time. The only way to record 2-channels on a stock iOS device is by using an Aple USB to Lightning connector (Camera Connection kit on older models) with a standard USB stereo ADC or an audio mixing panel which has multiple mic inputs.