← LeaderboardThe Skill Leaderboard

cracktro-voice

Regenerate, verify and wire the cracktro kiosk voice track (one Opus/WebM file per slide plus a caption-hash lookup table).

Published by github ↗github/gh-aw

Try your first task

A source-grounded starter task has not been verified for this skill yet.

SKILL.md

name: cracktro-voicedescription: Regenerate, verify and wire the cracktro kiosk voice track (one Opus/WebM file per slide plus a caption-hash lookup table).

Cracktro voice track

The kiosk voice (V) plays docs/public/cracktro/voice/<slide id>.webm. Each file is a two-anchor read of that slide's slides.md Captions. voice/index.js (window.CracktroVoice) maps each slide id to [caption hash, duration s]. The runtime plays a file only when its hash matches the slide's current captions. Any other slide falls back to browser speechSynthesis, so a stale file never speaks the wrong words.

  • Voices, timing, encoding and pronunciations (lexicon) are in voice.json. Editing it changes the config fingerprint and rebuilds every slide.
  • Anchor identities and caption-writing rules are in personas.md. Read it before writing captions.
  • Encoding choices and model licences are in ../speech-audio-encoding/SKILL.md.

When captions change (mandatory)

Run these from the repository root, then commit voice/index.js together with the changed .webm files:

node .github/skills/cracktro-voice/voice.mjs check           # dependency-free; exit 1 lists stale/missing/orphan slides
node .github/skills/cracktro-voice/voice.mjs build --deps "$TMPDIR/voicegen" --jobs 6
node .github/skills/cracktro-voice/voice.mjs check           # must print "voice track in sync"

docs/tests/talk.spec.ts ("keeps the recorded voice track in sync…") fails when the track is stale or has orphan files, or when it exceeds the size budget. If you can't run the build, say so in the PR. The deck still speaks the changed slides through the fallback.

Setup (once per machine)

npm install --prefix "$TMPDIR/voicegen" kokoro-js@1.2.1 ffmpeg-static@5.3.0

The first build downloads Kokoro-82M (Apache-2.0, about 330 MB) into the Hugging Face cache.

Build options

  • build rebuilds only stale slides. Add --slides a,b to limit it to specific ids, or --force to rebuild everything.
  • --jobs N sets the number of parallel synth workers; --threads N sets ONNX threads per worker. On an Apple M-series laptop, 6 jobs take about 2.5 min for a full rebuild.
  • --cache DIR (default $TMPDIR/cracktro-voice-cache) caches clips by engine, voice, speed and text. Changing only timing or encoding re-encodes without resynthesizing.
  • --ffmpeg PATH overrides ffmpeg-static.
  • onnxruntime may abort when the process exits after a successful build. Trust check, not the exit code.

Auditioning a voice change

Render the same caption with the candidate voices or speeds into a scratch folder, either under $TMPDIR or a temporary, uncommitted directory under docs/public/cracktro/. Play them in the browser canvas and let the author pick. Then update voice.json and personas.md together and run a full build. Keep the 32 kbps application audio encode: voip and lower bitrates sound robotic.

Runtime wiring

  • docs/public/cracktro/index.html loads ./voice/index.js before deck.js.
  • deck.js passes voice: window.CracktroVoice to CracktroDeck.create. Its type (base, slides) is in runtime.d.ts.
  • In runtime.js, voiceClip(i) returns the clip URL when captionHash matches, and voicePlay plays it. On an error or a rejected play(), it falls back to voiceSpeak.
  • The hash is captionHash in docs/src/lib/cracktro/slides.js. Keep the runtime copy identical.
  • captions.js is generated by the docs build and dev server. Under the bare python3 -m http.server preview there are no captions, so no audio plays. Use npm run dev in docs/ to hear the track.

Rules

  • Files live only in docs/public/cracktro/voice/; never under assets/ (avatars only).
  • Never add URLs to runtime.js or deck.js; clips load relative to the deck.
  • Never commit audition samples.