Why enabling Voice Processing on AVAudioInputNode changes channels count on its format?
10:02 12 Jul 2022

I've noticed that enabling voice processing on AVAudioInputNode change the node's format - most noticeably channel count.

let inputNode = avEngine.inputNode
print("Format #1: \(inputNode.outputFormat(forBus: 0))")
// Format #1: 
try! inputNode.setVoiceProcessingEnabled(true)
print("Format #2: \(inputNode.outputFormat(forBus: 0))")
// Format #2: 

Is this expected? How can I interpret these channels?

My input device is an aggregate device where each channel comes from a different microphone. I then record each channels to separate files. But when voice processing messes up with the channels layout, I cannot rely on this anymore.

ios macos avfoundation core-audio avaudioengine