androidengineers.Book a session

Interruptions and voice activity

Interruptions and voice activity

articleSelf-paced

Make the assistant stop speaking when the user takes the floor.

1. Voice activity decisions

Voice activity detection estimates when speech begins and ends. Tune for noise and pauses rather than treating every microphone sample as a new turn. Explain push-to-talk as an alternative control.

2. Barge-in handling

On an interruption, stop and flush queued playback for the old turn. Tag new audio with a turn identity so late chunks cannot restart the interrupted answer.

3. Echo and timing

Speaker output can leak into microphone input. Evaluate echo behavior on real hardware and audio routes. Measure interruption-to-silence time rather than only end-to-end model latency.

Worked scenario

The user says “stop” while the model speaks. Flushing the local playback queue is necessary even if the server has already stopped producing new audio.

Apply it

Inject an interruption between two delayed chunks. Verify the second old-turn chunk is discarded.

Check your understanding

An interrupted response cannot resume due to a late network event. Explain the decision and show evidence from your implementation or design. If you cannot demonstrate it yet, revisit the relevant section before continuing.

YOUR LEARNING JOURNEY

0 of 13 available lessons completed

Progress saved in this browser. No account needed.
Interruptions and voice activity | Gemini Live API for Android | Android Engineers