Posts

Post not yet marked as solved
1 Replies
1.5k Views
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.
Posted
by camerone.
Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
I'm searching for the best way to directly or indirectly create multiple taps on one AVAudioInputNode. I'm making an app with a conversational interface, and for architecture purposes it'd be useful to have one tap that deals with visualizing input audio and another that actually sends input audio to the speech recognizer. My attempts to do this are as follows, neither of which seem to work:1) Install multiple taps on AVAudioInputNode: It seems AVAudioInputNode only has one output bus, so you can't simply call installTap twice with different bus arguments. 2). Create two other AVAudioNodes, connect them downstream from the input nodes, and install taps on those.It seems like you can't create actual instances of AVAudioNode or AVAudioIONode, since they're really just base classes for other nodes. I've tried using AVAudioUnitEQ for this purpose but that doesn't work either. Any thoughts about my approach here? Not sure if I'm thinking about this the wrong way or if I'm just missing something obvious.
Posted
by camerone.
Last updated
.