Skip to content

fix(vad): bound live segments to guarantee transcript updates #756

Description

@safvanatzack

Problem

The live pipeline sends audio to ASR only when the active VAD segment closes. This leaves live transcript delivery unbounded: continuous speech or system audio can keep one segment open, grow the VAD buffer past its warning threshold, and withhold transcript updates even though audio is arriving.

PR #679 should use a 500 ms live redemption time to reduce the known 400 ms over-fragmentation. That is intentionally separate from this issue: redemption time controls ordinary pause handling; it cannot guarantee a bounded ASR request or a bounded interval between live transcript updates.

Import and retranscription keep their 2000 ms batch policy and are out of scope.

Goal

Give the live path an explicit bounded-segment policy so continuous speech produces incremental transcript updates without reintroducing short-request fragmentation, clipping, duplication, or silent loss.

Proposed policy

  • Define a live ASR segment target of 20 seconds and a hard maximum of 25 seconds, subject to replay validation.
  • When an active VAD segment reaches the hard maximum, dispatch a safe live ASR segment rather than waiting indefinitely for VAD to close it.
  • Preserve speech continuity across forced boundaries: no lost words, duplicated audio, or timestamps outside the recording duration.
  • Keep the 500 ms live redemption policy independent from the maximum-segment policy.

Non-goals

Acceptance criteria

  1. A continuous-speech or continuous-system-audio recording longer than two minutes receives incremental live transcript updates; the active VAD buffer never remains undispatched beyond the hard maximum.
  2. Normal conversational speech retains the reduced short-request fragmentation expected from the 500 ms live redemption policy.
  3. A forced boundary preserves complete, ordered transcript text and valid timestamps; stopping mid-utterance still satisfies start <= end <= recording duration.
  4. No duplicate transcript rows or silent chunk drops are introduced at forced boundaries.
  5. Regression coverage exercises a forced boundary and a final flush; manual replay covers the continuous-system-audio case that exposed the unbounded buffer.

Related work

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions