cracktro-voice
Regenerate, verify and wire the cracktro kiosk voice track (one Opus/WebM file per slide plus a caption-hash lookup table).
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 invoice.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
buildrebuilds only stale slides. Add--slides a,bto limit it to specific ids, or--forceto rebuild everything.--jobs Nsets the number of parallel synth workers;--threads Nsets 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 PATHoverrides 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.htmlloads./voice/index.jsbeforedeck.js.deck.jspassesvoice: window.CracktroVoicetoCracktroDeck.create. Its type (base,slides) is inruntime.d.ts.- In
runtime.js,voiceClip(i)returns the clip URL whencaptionHashmatches, andvoicePlayplays it. On an error or a rejectedplay(), it falls back tovoiceSpeak. - The hash is
captionHashindocs/src/lib/cracktro/slides.js. Keep the runtime copy identical. captions.jsis generated by the docs build and dev server. Under the barepython3 -m http.serverpreview there are no captions, so no audio plays. Usenpm run devindocs/to hear the track.
Rules
- Files live only in
docs/public/cracktro/voice/; never underassets/(avatars only). - Never add URLs to
runtime.jsordeck.js; clips load relative to the deck. - Never commit audition samples.