Skip to content

Add google stt voice activity timeout#4361

Merged
davidzhao merged 5 commits intolivekit:mainfrom
AhmadIbrahiim:add-google-stt-voice-activity-timeout
Feb 13, 2026
Merged

Add google stt voice activity timeout#4361
davidzhao merged 5 commits intolivekit:mainfrom
AhmadIbrahiim:add-google-stt-voice-activity-timeout

Conversation

@AhmadIbrahiim
Copy link
Copy Markdown
Contributor

@AhmadIbrahiim AhmadIbrahiim commented Dec 22, 2025

Add VoiceActivityTimeout support to Google STT V2

Fixes #4804

Adds timeout controls for speech detection in Google STT.

What's new

Two new parameters to control turn detection timing:

  • speech_start_timeout - How long to wait for speech to begin
  • speech_end_timeout - How much silence before considering the turn complete

Both support fractional seconds and handle the protobuf Duration conversion automatically.

Why?

Without these, you can't tune how patient the STT is with pauses or how long it waits for users to start talking. This helps prevent awkward cutoffs or long dead air.

Real-world impact: Chirp 3 has ~2.4s latency on short utterances like "hi". With speech_end_timeout=0.5, this can be reduced to ~500-800ms.

Usage

stt = google.STT(
    model="chirp_3",
    speech_start_timeout=10.0,
    speech_end_timeout=0.5,  # 500ms silence = end of turn
)

# Update on the fly
stt.update_options(speech_end_timeout=1.0)

Testing

13 tests covering defaults, updates, fractional seconds, and V1/V2 compatibility. All passing.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 22, 2025

CLA assistant check
All committers have signed the CLA.

@AhmadIbrahiim
Copy link
Copy Markdown
Contributor Author

Fixes #4804

@AhmadIbrahiim
Copy link
Copy Markdown
Contributor Author

Hey @theomonnom @longcw @keepingitneil - would appreciate a review on this when you get a chance!

This adds voice_activity_timeout support to Google STT which is critical for real-time voice agents. Without it, Chirp 3 has ~2.4s latency on short utterances making it impractical for conversational AI.

See issue #4804 for details. Thanks! 🙏

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Google API requires enable_voice_activity_events=True for
voice_activity_timeout to be effective. This change automatically
enables it when speech_start_timeout or speech_end_timeout is set.
@davidzhao davidzhao merged commit b87c5d2 into livekit:main Feb 13, 2026
9 checks passed
@AhmadIbrahiim AhmadIbrahiim deleted the add-google-stt-voice-activity-timeout branch February 13, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google STT: Add voice_activity_timeout support for faster endpointing (Chirp 3 has 2.4s latency)

3 participants