Turn Management
Barge-in
The engine has no interrupt message, so it keeps generating and streaming a reply after the user cuts it
off. ConversationManager.StopPlayback() therefore only silences what is already buffered: the streamer
clears its ring buffer and resets its loaded-sample count, and the next SpeechAudioEngineElement of the
same turn refills it and restarts playback once audioBufferMs has accumulated again — the reply picks
back up mid-sentence about a second later.
BargeIn() is StopPlayback() plus the guard that closes that gap. It records the turn being cut off in
_bargedTurnId, and speech audio carrying that turn id is dropped rather than played. The record is
cleared as soon as a non-synthetic user transcript arrives, that being the engine acknowledging it has
moved on, so a reply is never dropped even if it carries the turn id of the utterance it answers.
Only the push-to-talk press barges in. The stop that Natural mode performs off the user’s transcript must
not arm the guard: by then _currentTurnId is the transcript’s own turn, which the reply may share, and
the engine has already heard the user and stopped generating on its own.