Skip to content
CodexdebugWeb6 files · +387 −67

Fix VoxCPM word-click audio cache leaks and build a labeled boundary benchmark

Session from read-along-ai-agent-traces on Hugging Face by kingkw1 · MIT · condensed by Coders Talk

51msession
0interventions
GOAL

Improve word-click playback accuracy for a read-along app by diagnosing cross-sentence audio cache leaks, testing VoxCPM pause-prompting variants, and building a benchmark against manually labeled word boundaries.

  1. Prompt · +0
    Implement forced-alignment-style word timestamps for VoxCPM sentence audio instead of proportional slicing, with fallback and tests.
  2. Agent did · +0m
    Added logging and UI status visibility (alignment vs proportional fallback) to app.py, plus tests; suite passes (22 tests).
  3. Prompt · +5m
    Reported that word clips leak across sentences (cached 'the' from 'the cat sat' bleeds into 'the dog ran fast'); asked for curriculum WAVs to manually timestamp and compare methods.
  4. Agent did · +6m
    Made TTS_MEMORY_CACHE sentence-scoped and cleared on new prewarm to stop stale word clips leaking across sentences; added regression test; suite passes.
  5. Agent did · +7m
    Built scripts/generate_curriculum_wavs.py to synthesize full-sentence WAVs per curriculum item with a manifest for manual annotation; fixed import path and Conda linker issue, generated 4 WAVs.
  6. Prompt · +13m
    Asked whether VoxCPM could produce longer silences between words to make manual/automatic word separation easier.
  7. Prompt · +17m
    Asked to generate multiple punctuation-prompting variants (comma, period, spaced-comma, natural) of each sentence for comparison.
  8. Agent did · +17m
    Extended generator to produce natural/comma/period/spaced_comma variants, generated 16 WAVs total for listening comparison.
  9. Prompt · +39m
    Reported comma-separated variant sounded best; asked for the best way to manually label word start/stop times (Audacity labels?).
  10. Prompt · +50m
    Provided manually labeled Audacity timestamp files for the comma variant; asked for a benchmark test and git strategy for committing the audio assets.
  11. Agent did · +50m
    Built test_word_boundary_benchmark.py parsing Audacity labels, scoring boundary correctness against manual silence gaps, added proportional_word_timestamps baseline, and scoped .gitignore to allow committing the comma benchmark WAVs.
  12. Outcome · +51m
    Benchmark suite passes (7 tests, 1 xfail) confirming proportional slicing fails the manual-label benchmark; sentence-scoped cache fix and 16 punctuation-variant WAVs plus labeled comma benchmark committed for a future alignment pass.
VERDICT

Next time I'd start by asking for a ground-truth labeling workflow and benchmark harness before building any alignment logic, since that's what actually let us tell good methods from bad ones. Pointing out the exact cross-sentence cache leak ('the cat sat' bleeding into 'the dog ran fast') was the correction that mattered — it revealed the real bug wasn't slicing precision but stale cached clips. The punctuation-variant experiment (comma vs period vs natural) was cheap to generate and gave us a clear winner before investing in alignment.

I tried this · 0

Discussion · 0

How Builds work