AVAudioInputNode setup

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

Answered by Engineer in 890473022

The general performance recommendation is to use the microphone only for as long as needed — i.e., for the duration of the push to talk window.

Accepted Answer

The general performance recommendation is to use the microphone only for as long as needed — i.e., for the duration of the push to talk window.

AVAudioInputNode setup
 
 
Q