iOS: Is it possible to record from multiple microphones at the same time

1.2k Views Asked by At

All the recent iPhones have 2+ microphones. Is it possible to record from all the microphones at the same time? If this is possible, what is the best iOS audio library for this (AudioKit, EzAudio, AudioUnits, CoreAudio)? There is no mention of this functionality in AudioKit and EzAudio.

2

There are 2 best solutions below

0
On BEST ANSWER

I don't see anything in the documentation about multi-mic audio capture being possible. They specify that you can choose a specific microphone but not that you can select more than one simultaneously. AVAudioSession is also a singleton.

Seemingly, at least as of iOS 10, AVCaptureSession also only allows one audio or video input concurrently.

1
On

Since, you can record stereo audio, you can definitely record from multiple microphones at once. Furthermore, since noise cancellation is likely using the 1+ microphones not participating in the stereo recording, it is likely “recording” or at least using all microphones at once.

However, I think the main crux of the questions is if we can get the audio input of each microphone separately at the same time. As Dare points out, the standard API does not support that.

However, assuming there is a one-to-one mapping from microphone source (eg top/bottom) to audio channel (left/right), a theoretical solutions exists…

Simply record in stereo, then separate out the left/right channels, and viola, you can grab the input from each microphone separately. I have not tested this out yet, but in theory it seems like it should work.

If you specifically want to know which channel corresponds to which microphone, you’ll likely need to inspect the device orientation, and have a table of where the microphones are located based on device type. For example:

if orientation == landscapeLeft && device == iPhoneX {
  print(“the right audio channel source is the Face ID microphone”)
  print(“the left audio channel source is the dock connector microphone”)
} …