Skip to content

feat(whisper+captions): language detection, audio-reactive captions, multilingual defaults - #175

Merged
vanceingalls merged 9 commits into
mainfrom
vance/whisper-improvements
Apr 2, 2026
Merged

vanceingalls merged 9 commits into
mainfrom
vance/whisper-improvements

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Apr 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Whisper improvements:

  • Auto-detect language and switch from .en to multilingual model when needed
  • Detect speech onset in WAV to strip hallucinated words before speech begins
  • Merge whisper-cpp token fragments: contractions (didn + 't → didn't), split capitals (C + aught → Caught), dropped-g (shin + in' → shinin')
  • Interpolate zero-duration word clusters for reliable karaoke timing

Captions skill updates (folded from #176):

  • Rewrite script-to-style mapping as an energy detection table (high → low) with mandatory animation requirements: karaoke baseline, 2+ highlight techniques, kinetic exits
  • Replace tl.call() per-frame audio-reactive pattern with group-level GSAP tweens — read peak bass/treble for each group's time range and modulate entrance intensity at build time
  • Add transcript quality check with automatic retry rules (>20% music tokens = retry with larger model)
  • Add caption word structure lint rule (.caption-group + <span>) for studio editor compatibility

Multilingual defaults (folded from #186):

  • Default whisper model changed from small.en to small to prevent silent translation of non-English audio
  • Added non-negotiable language rule to captions skill

Test plan

  • pnpm test passes (contraction merging, fragment merging, zero-duration interpolation, speech onset)
  • Transcribe non-English audio — verify it transcribes in original language, not translates
  • Skill files render correctly, cross-references resolve
  • dynamic-techniques.md audio-reactive section uses tl.to()/tl.set() only, no tl.call() loops

🤖 Generated with Claude Code

vanceingalls commented Apr 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

@vanceingalls
vanceingalls force-pushed the vance/whisper-improvements branch from c47472a to 28e707c Compare April 1, 2026 22:05
@vanceingalls
vanceingalls force-pushed the vance/dynamic-captions branch from 504b446 to afa5021 Compare April 2, 2026 05:30
@vanceingalls
vanceingalls force-pushed the vance/whisper-improvements branch from 28e707c to 4b0ce61 Compare April 2, 2026 05:30
@vanceingalls
vanceingalls changed the base branch from vance/dynamic-captions to graphite-base/175 April 2, 2026 05:47
@vanceingalls
vanceingalls force-pushed the vance/whisper-improvements branch from 4b0ce61 to 436cd55 Compare April 2, 2026 05:57
@vanceingalls
vanceingalls changed the base branch from graphite-base/175 to vance/dynamic-captions April 2, 2026 05:57
@vanceingalls
vanceingalls changed the base branch from vance/dynamic-captions to graphite-base/175 April 2, 2026 06:24
@vanceingalls
vanceingalls force-pushed the vance/whisper-improvements branch from 436cd55 to 7085bdc Compare April 2, 2026 06:24
@graphite-app
graphite-app Bot changed the base branch from graphite-base/175 to main April 2, 2026 06:25
- Auto-detect language and switch from .en to multilingual model when needed
- Detect speech onset in WAV to strip hallucinated words before speech begins
- Merge whisper-cpp token fragments: contractions (didn + 't → didn't),
  split capitals (C + aught → Caught), dropped-g (shin + in' → shinin')
- Interpolate zero-duration word clusters for reliable karaoke timing
- Replace non-null assertions with optional chaining in tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls
vanceingalls force-pushed the vance/whisper-improvements branch from 7085bdc to 4e51632 Compare April 2, 2026 06:25
vanceingalls and others added 6 commits April 2, 2026 06:25
…y checks

- Rewrite script-to-style mapping as energy detection table
- Add mandatory animation design requirements (karaoke baseline, technique cycling)
- Simplify dynamic-techniques.md to technique selection reference
- Add transcript quality check with automatic retry rules
- Add multilingual model guidance and decision tree

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Never overflow: hidden on caption containers — clips glow/scale effects
- Music requires audio-reactive captions (any genre, any energy level)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The player needs window.__timelines registered immediately to start
playback. GSAP timelines are mutable so tl.call() entries added
later in the fetch callback still fire when seeked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documents the inline TRANSCRIPT requirement, JSON-quoted keys, and
CSS class conventions needed for the studio caption editor to detect
and edit captions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds two lint rules for caption compositions:
- caption_transcript_not_inline: warns when transcript is loaded via
  fetch() instead of an inline var TRANSCRIPT array
- caption_transcript_parse_error: warns when the inline TRANSCRIPT
  array is not valid JSON (common with unquoted keys + apostrophes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vanceingalls and others added 2 commits April 2, 2026 06:25
…slation

.en models (small.en, medium.en) translate non-English audio into English
instead of transcribing it. This silently destroys the original language.

- Add non-negotiable language rule to captions skill
- Update model tables to default to models without .en suffix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls changed the title feat(whisper): language detection, speech onset, contraction merging feat(whisper+captions): language detection, audio-reactive captions, multilingual defaults Apr 2, 2026
@vanceingalls
vanceingalls merged commit 37404f2 into main Apr 2, 2026
21 of 22 checks passed
dahans-msft2 pushed a commit to dahans-msft2/hyperframes that referenced this pull request Aug 6, 2026
…multilingual defaults (heygen-com#175)

## Summary

**Whisper improvements:**
- Auto-detect language and switch from `.en` to multilingual model when needed
- Detect speech onset in WAV to strip hallucinated words before speech begins
- Merge whisper-cpp token fragments: contractions (`didn` + `'t` → `didn't`), split capitals (`C` + `aught` → `Caught`), dropped-g (`shin` + `in'` → `shinin'`)
- Interpolate zero-duration word clusters for reliable karaoke timing

**Captions skill updates (folded from heygen-com#176):**
- Rewrite script-to-style mapping as an energy detection table (high → low) with mandatory animation requirements: karaoke baseline, 2+ highlight techniques, kinetic exits
- Replace `tl.call()` per-frame audio-reactive pattern with group-level GSAP tweens — read peak bass/treble for each group's time range and modulate entrance intensity at build time
- Add transcript quality check with automatic retry rules (>20% music tokens = retry with larger model)
- Add caption word structure lint rule (`.caption-group` + `<span>`) for studio editor compatibility

**Multilingual defaults (folded from heygen-com#186):**
- Default whisper model changed from `small.en` to `small` to prevent silent translation of non-English audio
- Added non-negotiable language rule to captions skill

## Test plan

- [ ] `pnpm test` passes (contraction merging, fragment merging, zero-duration interpolation, speech onset)
- [ ] Transcribe non-English audio — verify it transcribes in original language, not translates
- [ ] Skill files render correctly, cross-references resolve
- [ ] `dynamic-techniques.md` audio-reactive section uses `tl.to()`/`tl.set()` only, no `tl.call()` loops

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants