Skip to content

feat: pluggable walkthrough voices, with a local Kokoro voice - #4

Closed
JamesFranc wants to merge 3 commits into
denormans:mainfrom
JamesFranc:kokoro-voice
Closed

JamesFranc wants to merge 3 commits into
denormans:mainfrom
JamesFranc:kokoro-voice

Conversation

@JamesFranc

@JamesFranc JamesFranc commented Oct 20, 2026 •

Copy link
Copy Markdown

What

Adds Kokoro as a local narration voice for architecture walkthrough videos. Kokoro, ElevenLabs and the macOS voice now all plug in through one Voice interface.

  • WALKTHROUGH_VOICE names the voice: kokoro, elevenlabs or mac.
    • Unset or empty keeps today's behaviour: ElevenLabs when ELEVEN_LABS_API_KEY is set to a non-blank value, else the macOS voice when WALKTHROUGH_MAC_VOICE is set, else a silent video with subtitles.
    • elevenlabs without a key, mac without WALKTHROUGH_MAC_VOICE, or any other value fails the render before any work starts.
  • kokoro narrates through uv, running kokoro and soundfile at pinned versions under Python 3.12. KOKORO_VOICE picks the speaker (default af_heart). Only American or British English voices (prefix a or b) are accepted, because only those come back with word timings, and the render needs them to time scene cues.
  • walkthrough/voice.ts defines the Voice interface and the pieces every voice shares. elevenlabs.ts, kokoro.ts and mac-voice.ts each implement it. voices.ts holds the registry and the one selection rule that both walkthrough render and check-tools use, so check-tools reports only the voice that will narrate as configured.
  • Each voice's preflight sets its own exit code, so the macOS voice's exit codes are unchanged.
  • Narration is cached by voice and text. Cache keys for ElevenLabs and the macOS voice are unchanged, so existing caches are reused, and tests pin all three voices' keys.

The README covers Kokoro setup and the variables. skills/architecture/references/walkthrough.md covers voice selection and adding a voice.

Why

Without an ElevenLabs key or macOS, walkthrough videos render silent, with the narration as subtitles. Kokoro gives narrated videos on any platform at no cost and without a network service. Putting voices behind one interface means adding another is a module implementing Voice, plus registry, check-tools and docs entries that the walkthrough reference lists, with no changes to the renderer.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd0414be-3b4a-4cd7-9412-cb4b59728283
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@JamesFranc
JamesFranc marked this pull request as ready for review October 20, 2026 17:29
@JamesFranc JamesFranc changed the title feat: narrate walkthrough videos with a local Kokoro voice feat: pluggable walkthrough voices, with a local Kokoro voice Oct 20, 2026
JamesFranc and others added 3 commits October 21, 2026 00:19
A free, offline voice beside ElevenLabs, chosen with WALKTHROUGH_VOICE=kokoro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared voice types, cache helpers, SPEED and VoiceError (was TtsError) moved to voice.ts;
tts.ts became elevenlabs.ts; voices.ts holds the registry and the one selection used by
render and check-tools. WALKTHROUGH_VOICE=elevenlabs is now valid, and only the selected
voice reads configured in check-tools. A whitespace-only ELEVEN_LABS_API_KEY counts as
unset in both, so it no longer reaches ElevenLabs.
The macOS voice from v1.101.0 plugs in through the same registry, and
WALKTHROUGH_VOICE=mac selects it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdnorman

Copy link
Copy Markdown
Contributor

Thank you for this! The idea is being adopted: a local Kokoro voice for walkthrough narration, behind a shared voice interface.

This repository is a published snapshot, so changes land in the source repository and reach here with a release. Rather than merging this PR, we re-implemented the idea there:

  • WALKTHROUGH_KOKORO_VOICE names the speaker.
  • Voice priority is ElevenLabs, then the macOS voice, then Kokoro, then a silent, subtitled render.
  • You're credited as a co-author on the commit.

It will show up here in a future release. Closing this one in favour of that change.

@mdnorman mdnorman closed this Oct 21, 2026
@mdnorman

Copy link
Copy Markdown
Contributor

This shipped in v1.102.0.

A correction to my earlier comment: the co-author credit is on the commit in the source repository, but the release commit here doesn't carry it. I've added a credit line to the release notes instead, and future releases will keep co-author credit on the release commit.

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