Repository navigation
fix(stt): apply speech timestamp fixes onto the connection refactor - #8333
chenghao-mou wants to merge 2 commits into
Conversation
Port #7795 and #7796 onto the shared STT connection coordinator, with #7739 that they build on. Each provider connection restarts the input clock. RTZR detects idle in the send loop, and Gladia and Reson8 re-anchor each session on its first frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
STT Test ResultsStatus: ✗ Some tests failed
Failed Tests
Skipped Tests
Triggered by workflow run #5700 |
7f7337e to
bab5a95
Compare
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| while self._pending_padding: | ||
| start, duration = self._pending_padding[0] | ||
| if start + duration > provider_time: | ||
| break | ||
| self._settled_padding += duration | ||
| self._pending_padding.popleft() |
There was a problem hiding this comment.
🟡 Late word boundaries shift before speech
When a later timestamp precedes a delayed end_text, remove_padding subtracts settled silence from the earlier word boundary. The speech end moves backward, sometimes before the stream starts.
Learn more
Gradium's text messages map start_s through remove_padding, while end_text carries the previous word's stop_s for the final boundary here. A newer text timestamp can settle a synthetic silence interval before the previous word boundary arrives. The settled amount then gets subtracted from the earlier boundary even though that boundary predates the silence.
Example: Add one second of audio and 0.48 seconds of padding. Look up 1.6 seconds, then the delayed word boundary at 0.4 seconds. The second lookup returns -0.08 seconds instead of 0.4 seconds.
Recommended fix: Retain enough history to resolve earlier provider timestamps, or defer settling padding until no earlier word boundaries can arrive. Cover a text timestamp after padding followed by an earlier end_text boundary.
Was this helpful? React with 👍 or 👎 to provide feedback.
Ports #7795 and #7796 onto #8147, plus #7739, which they build on. Nothing else from
mainis included. Your coordinator stays; each provider connection restarts the input clock.Where ours wins:
start_time_offset; Gladia's queued-audio test now expects capture time.Initial prompt and agent context
Model: Claude Opus 5.5
Chenghao chose our approach for Gladia session timing and RTZR idle handling after reviewing the tradeoff.
🤖 Generated with Claude Code