This post is from the WWDC26 Audio Q&A.
What's the best way of dealing with AVAudioInputNode from resources perspective?
Ideally, to install it as soon as it is necessary for microphone access and use it as long as it is necessary (for example, when you have a long voice chat where users exchange voice messages intermittently AVAudioInputNode should be installed at the beginning and kept until the chat ends)
Or is it better to setup it
inputNode.installTap(
onBus: bus,
bufferSize: bufferSize,
format: format,
block: { buffer, _ in }
)
everytime user accessing microphone with push to talk
The question is what's better from a performance perspective