3

This thread talks about switching the audio input route, but I'm wondering if it's possible to take input from two routes simultaneously. I am working on an application that will record audio using an external microphone to help deal with noise, but I would also like to record with the internal microphone too so I can compare the two.

I feel like this will take quite a bit of digging through the AVAudioSession docs to figure out, and having a quick yes or no answer before then would save me a lot of time.

Any help would be appreciated!

Community
  • 1
  • 1

2 Answers2

1

Though I haven't used it myself but.. Have you tried setting AVAudioSessionCategoryMultiRoute category in AVAudioSession.

This is what Apple docs says - For routing distinct streams of audio data to different output devices at the same time. For example, you would use this category to route audio to both a USB device and a set of headphones. Use of this category requires a more detailed knowledge of, and interaction with, the capabilities of the available audio routes. This category may be used for input, output, or both.

Usage example -

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryMultiRoute error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];

Please let me know/comment if it doesn't help so I delete this answer.

Ashok
  • 6,224
  • 2
  • 37
  • 55
1

I don't think you can do it. For multiple audio devices, you are supposed to use the category AVAudioSessionCategoryMultiRoute, but the AVAudioSession.h header file has this to say on input:

 Input is limited to the last-in input port.
Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159