0

I'm trying to record voice audio with either AVAudioRecorder or AUAudioUnit.

In both, after a recording has started, whenever calling AVCaptureDevice.showSystemUserInterface(.microphoneModes) and selecting voice isolation, I get the following error:

"Voice Isolation and Wide Spectrum are currently unavailable"

TLDR: What do I need to allow the user to change to voice isolation mode?

pinglock
  • 982
  • 2
  • 12
  • 30
  • 1
    Per this video, Mic Modes are only available through AVCaptureDevice: https://developer.apple.com/videos/play/wwdc2021/10047/?time=1384 – Asteroid Jun 02 '22 at 20:17

1 Answers1

0

I have an application that plays audio in real time and the audio separation mode is available by writing the following.

private let audioEngine = AVAudioEngine()

// omission (of middle part of a text)

let audioInput = audioEngine.inputNode
audioInput.isVoiceProcessingBypassed = true
do {
    try audioInput.setVoiceProcessingEnabled(true)
} catch {
    print("Could not enable voice processing \(error)")
    return
}
let audioFormat = audioEngine.inputNode.outputFormat(forBus: 0)
audioEngine.connect(audioInput, to: audioEngine.mainMixerNode, format:audioFormat)

Since I am using AVAudioEngine, I believe your objective can be achieved by simply changing the AVAudioEngine output destination.

Funa
  • 1
  • 1