Skip to content

fix(deepgram): end_time should be the last word, not the first - #6712

Merged
longcw merged 1 commit into
livekit:mainfrom
mdylan2:fix/deepgram-end-time-last-word
Aug 6, 2026
Merged

fix(deepgram): end_time should be the last word, not the first#6712
longcw merged 1 commit into
livekit:mainfrom
mdylan2:fix/deepgram-end-time-last-word

Conversation

@mdylan2

@mdylan2 mdylan2 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

live_transcription_to_speech_data takes both start_time and end_time from the first word, since next() returns the first item of the generator:

start_time=next((word.get("start", 0) for word in alt["words"]), 0) + start_time_offset,
end_time=next((word.get("end", 0) for word in alt["words"]), 0) + start_time_offset,

prerecorded_transcription_to_speech_event in the same file uses alt["words"][-1]["end"], which is what this changes the streaming path to match.

It shows up on barge-in. audio_recognition.py drops a held transcript whose end_time falls before the cutoff, so "wait, I have a question" is judged on when "wait" ended and the whole turn can be discarded. Easy to miss because interim results are often a single word, where first and last are the same.

@mdylan2
mdylan2 marked this pull request as ready for review August 5, 2026 16:17
@mdylan2
mdylan2 requested a review from a team as a code owner August 5, 2026 16:17

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@longcw
longcw merged commit 489c339 into livekit:main Aug 6, 2026
18 checks passed
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.

2 participants