I'm getting an error/crash when I attempt to call AVAudioIONode.setVoiceProcessing(true) on an AVAudioInputNode object. It's a different error depending on what code I'm calling it on. In the Spoken Word demo, I call it after I set the AudioSession active and set categories:
let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(.record, mode: .measurement, options: .duckOthers) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) let inputNode = audioEngine.inputNode try inputNode.setVoiceProcessingEnabled(true)
Which results in a crash/error:
AVAEInternal.h:76 required condition is false: [AVAEGraphNode.mm:823:CreateRecordingTap: (IsFormatSampleRateAndChannelCountValid(format))]
Elsewhere, in my own app, I get a non-crashing, different error that prints in the console seemingly every time the node's tap buffers:
AUBuffer.h:61:GetBufferList: EXCEPTION (-1) [mPtrState == kPtrsInvalid is false]: ""
Any ideas what these mean? If there some limitation of this function that has to do with buffer/sizes taps? The Using Voice Processing example calls this function with no errors, but I can't tell what that app is doing differently, apart from being more specific about file formats.