With the new iOS version there's a new mic mode that i need to enable on my app. However i don't see any example in Google or in YouTube. If someone can help me in showing how to enable mic mode in new iOS 15, would be great help.
Thankyou.
From my testing, it doesn't seem possible to set the microphone mode to standard, voice isolation or wide spectrum programmatically. Though you might be able to get what the microphone mode value is. However, using these steps, you can allow your users to set it up by themselves:
let audioSession = AVAudioSession.sharedInstance()
do {
try? audioSession.setCategory(.playAndRecord, mode: .videoRecording, options: .allowBluetooth)
try? audioSession.setActive(true)
let node = audioEngine.inputNode
node.isVoiceProcessingAGCEnabled = true
node.isVoiceProcessingBypassed = false
node.isVoiceProcessingInputMuted = false
try? node.setVoiceProcessingEnabled(true)
...
AVCaptureDevice.showSystemUserInterface(.microphoneModes)
Then the user is able to make a change to either wideSpectrum or voiceIsolation. Without following step 1, you will get an error message saying that the Microphone mode cannot be changed