Skip to content

feat: bridge short silence gaps in pre-roll to capture plosive onsets - #45

Merged
tai2 merged 1 commit into
mainfrom
improve-voice-onset-detection
Apr 17, 2026
Merged

feat: bridge short silence gaps in pre-roll to capture plosive onsets#45
tai2 merged 1 commit into
mainfrom
improve-voice-onset-detection

Conversation

@tai2

@tai2 tai2 commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds gap tolerance (200ms) to findPreRollStartFrame() so the backward scan bridges brief intra-word silences (geminate consonants, stop consonant releases) instead of treating them as the pre-speech boundary
  • Fixes clipped plosive-initial words like Japanese "kitto" (きっと) where the initial "ki" burst was dropped because a sub-threshold gap separated it from the sustained voice that triggered onset detection
  • Adds two new unit tests: one verifying short gaps are bridged, one verifying long gaps (>200ms) are not

Test plan

  • pnpm typecheck passes
  • pnpm lint passes (no new warnings)
  • pnpm test:ci passes — all 116 tests including 2 new ones
  • Manual test: record a plosive-initial word (e.g. "kitto") and verify the initial consonant is captured in playback

🤖 Generated with Claude Code

…nsets

Words beginning with a brief plosive burst followed by a sub-silence gap
(e.g. Japanese "kitto" with geminate consonant "っ") were losing their
initial fragment because findPreRollStartFrame stopped at the first
below-threshold chunk. The backward scan now tracks consecutive silence
duration and only terminates when the gap exceeds 200ms, bridging brief
intra-word silences like geminate consonants and stop consonant releases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tai2
tai2 merged commit e7b05d7 into main Apr 17, 2026
1 check 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.

1 participant