Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the stereo (2 channel) built in microphone in iPhone XS, inside AVAudioSession?

I'm trying to get both channels from the supposedly stereo rear microphone out of the iPhone XS but can only ever see a single channel at various points in the AVAudioSession and AVAudioSessionPortDescription's associated with the rear camera.

I have tried using AVAudioSession APIs like setPreferredInputNumberOfChannels:

do {
    try session.setPreferredInputNumberOfChannels(2)
} catch let error {
    debugPrint("\(error)")
}

But get an error:

Error Domain=NSOSStatusErrorDomain Code=-50

Has anyone had experience getting a 2-channel built-in mic route working?

like image 924
jameshartt Avatar asked Jun 25 '19 16:06

jameshartt


People also ask

Does iPhone have stereo microphone?

iOS provides a number of ways to record audio from the built-in microphones, but until now it's been limited to mono audio only. Starting in iOS 14 and iPadOS 14, you can now capture stereo audio using the built-in microphones on supported devices.

Does iPhone Voice Memo record in stereo?

Recordings using the built-in microphone are mono, but you can record stereo using an external stereo microphone that works with iPhone.


1 Answers

The stereo microphone on the iPhone XS is placed at the bottom on the left side of the lightning connector. The one on the right side of the lightning connector is a noise cancelling microphone. The 2 other microphones are placed next to the front camera and the back camera. But those are only mono microphones. But there is a big BUT when it comes to the bottom stereo microphone. It only records in stereo when using the build in camera app. Voice only in the voice memo app only records in mono. And, the stereo microphone is not compatible with any third party app. It only works when shooting video in the native camera app.

like image 106
Tom Hiel Avatar answered Nov 15 '22 08:11

Tom Hiel