Hello,
In my app I am observing the AVAudioEngineConfigurationChange notification. It uses AVAudioEngine, its audio input node, some samplers, some effects, some mixers, and the output node.
So when I plug in an external audio interface into the iPad my observer is called. AVAudioSession.inputNumberOfChannels tells me there are now 6 input channels instead of 1 (the audio interface indeed has 6 inputs). However, my current AVAudioEngine's inputNode format still shows 1 channel.
How do I get the engine to update the input node's format?
Should I allocate a new engine and discard the old one?
The documentation explicitly says, "The engine must not be deallocated from within the client's notification handler".
https://developer.apple.com/documentation/foundation/nsnotification/name/1389078-avaudioengineconfigurationchange
I am at a loss. Should I refrain from using AVAudioEngine.inputNode and allocate my own instance?
I have also tried to reconnect the inputNode with the new hardware format to the next node in the graph, like the documentation suggests. As a result the next node render call fails to pullInput() with code kAudioUnitErr_CannotDoInCurrentContext (it's my own custom AU effect so I can tell).
Please assist.
In my app I am observing the AVAudioEngineConfigurationChange notification. It uses AVAudioEngine, its audio input node, some samplers, some effects, some mixers, and the output node.
So when I plug in an external audio interface into the iPad my observer is called. AVAudioSession.inputNumberOfChannels tells me there are now 6 input channels instead of 1 (the audio interface indeed has 6 inputs). However, my current AVAudioEngine's inputNode format still shows 1 channel.
How do I get the engine to update the input node's format?
Should I allocate a new engine and discard the old one?
The documentation explicitly says, "The engine must not be deallocated from within the client's notification handler".
https://developer.apple.com/documentation/foundation/nsnotification/name/1389078-avaudioengineconfigurationchange
I am at a loss. Should I refrain from using AVAudioEngine.inputNode and allocate my own instance?
I have also tried to reconnect the inputNode with the new hardware format to the next node in the graph, like the documentation suggests. As a result the next node render call fails to pullInput() with code kAudioUnitErr_CannotDoInCurrentContext (it's my own custom AU effect so I can tell).
Please assist.