Skip to content

Detect click/pop discontinuities and correlate them with playback events #4

Description

@engkimo

Problem

A caller can hear a click or pop when playback is interrupted, a provider chunk boundary is mishandled, or adjacent PCM frames have a large discontinuity. VoxBench records queue clearing, provider chunks, and stage PCM quality, but it does not yet emit a bounded click/pop observation.

Goal

Add a deterministic, explainable discontinuity metric and correlate suspicious points with existing playback, barge-in, and serializer evidence.

Design requirements

  • Define the signal contract first: sample format, window, threshold units, minimum signal level, and treatment of silence.
  • Prefer a simple explainable time-domain detector before a learned classifier.
  • Report bounded metadata only; do not persist additional raw PCM.
  • Keep stage media time separate from wall-clock event time.
  • Avoid duplicate incidents across adjacent windows.
  • State confidence and preserve remote_playout_observed: false unless another adapter proves playout.

Acceptance criteria

  • Synthetic fixtures cover a clean boundary, a zero-crossing boundary, a strong non-zero discontinuity, silence, and clipped PCM.
  • The observation includes stage, media-time location, magnitude, and detector contract/version.
  • Existing barge-in or queue-clear evidence can be referenced when temporally correlated.
  • The default test suite is deterministic and requires no audio device or provider key.
  • Documentation explains what the detector can and cannot prove.

Likely areas

  • src/voxbench/observability/observer.py
  • src/voxbench/telephony/audiosocket.py
  • src/voxbench/control_plane/run_api.py
  • tests/test_observability.py
  • tests/test_audiosocket.py
  • Web incident rendering if a new incident is added

Out of scope

  • Claiming subjective audibility from a single threshold.
  • Retaining caller recordings by default.
  • A provider-specific implementation.

Audio/DSP and realtime review are especially welcome on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions