Skip to content

JPeetz/agent-skills / skills/marketing/local-video-production-m5

local-video-production-m5

Verified

Use this skill when producing local videos on the 16GB M5 executor.

references/kokoro-tts-mature-voice.md

View on GitHub
# Kokoro TTS (mature voice) — local narration leg

Kokoro via sherpa-onnx is the proven local TTS for message videos. Venv:
`~/.venvs/kokoro/bin/python`; script: `~/workspace/scripts/kokoro_tts.py`.
Usage: `kokoro_tts.py <sid> <speed> <out.wav> "<script text>"`.

**sid 10 = the mature Hermes voice** (what produced `tts_hermes_final.wav`).

## Model files

- Dir: `~/.hermes/kokoro/kokoro-multi-lang-v1_0/` (model.onnx ~325 MB,
  voices.bin, tokens.txt, lexicon-us-en.txt, lexicon-zh.txt, espeak-ng-data/).
- **Download as ONE tar.bz2 asset, not individual files.** The k2-fsa
  /sherpa-onnx `tts-models` release publishes `kokoro-multi-lang-v1_0.tar.bz2`
  (~336 MB) and the individual-file URLs (`.../tts-models/kokoro-multi-lang-v1_0/model.onnx`)
  ɢ return 404. Enumerate real assets from the GitHub releases API
  (`repos/k2-fsa/sherpa-onnx/releases/tags/tts-models`) before guessing URLs.
- Config objects (model/voices/tokens/data_dir/lexicon) must match the dir.

## Long-audio write pitfall

`kokoro_tts.py` originally wrote WAV with
`struct.pack("<%dh" % len(s), *s)`. On a full narration (~530k samples) the
unpacking explodes and `wave.close()` then throws
`AttributeError: 'Wave_write' object has no attribute '_file'` — a misleading
cascade; the real error is the giant `struct.pack`. Fix: build an
`array('h', s)` (byteswap on big-endian hosts) and `writeframes(a.tobytes())`.
Also confirm the output directory EXISTS before calling — a missing dir
produces the same `_file`-attribute cascade from `wave.open` failure.
Short test clips (8 s) can pass even when a full narration fails, so always
test with the actual script length.

## Sentence-splitting for segmented renders

Kokoro reads nearly continuously (often a single silence gap for the whole
pass), so `silencedetect` alone won't find sentence boundaries. Cut by
proportional character count per sentence with ~0.15 s pre-roll and ~0.25 s
tail: total_duration × sentence_chars / total_chars gives per-sentence dur;
use `ffmpeg -ss L -to R -c copy` per segment. Render EACH sentence as its own
A2V chunk (identity re-anchor per chunk), then concat.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall