wasCapturing is set synchronously inside QueueAudioOutput.clearBuffer
based on whether QueueAudioOutput.captureFrame had been called for the
current segment. Consumers should use this — not their own asynchronous
"is the avatar speaking?" flag — to decide whether to call
QueueAudioOutput.notifyPlaybackFinished, otherwise an interrupt that
lands in the window between captureFrame and the consumer's reader can leak
playbackSegmentsCount > playbackFinishedCount and deadlock
AudioOutput.waitForPlayout.
Payload emitted with the QueueAudioOutput
'clear_buffer'event.wasCapturingis set synchronously inside QueueAudioOutput.clearBuffer based on whether QueueAudioOutput.captureFrame had been called for the current segment. Consumers should use this — not their own asynchronous "is the avatar speaking?" flag — to decide whether to call QueueAudioOutput.notifyPlaybackFinished, otherwise an interrupt that lands in the window betweencaptureFrameand the consumer's reader can leakplaybackSegmentsCount > playbackFinishedCountand deadlock AudioOutput.waitForPlayout.