speech-audio-encoding
Installation
SKILL.md
Speech audio encoding
Use this skill to turn text into speech audio that ships in a repository or a static site. It is based on the githubnext/agentics workflows/shared/ffmpeg.md guidance (Opus for voice, strip metadata, hash inputs for caching). For the cracktro deck, the cracktro-voice skill wraps all of this in one script.
Rules
- Generate with a local open model: Kokoro-82M (
kokoro-js, Apache-2.0, 24 kHz mono). No cloud TTS, keys or uploads. Write the model id, dtype and voice ids into a committed config so a rerun reproduces the voice. - Install tools in
$TMPDIR, never in the repository:npm install --prefix "$TMPDIR/<name>-deps" kokoro-js@1.2.1 ffmpeg-static@5.3.0.ffmpeg-staticships libopus; a systemffmpegwith--enable-libopusworks too (ffmpeg -hide_banner -encoders | grep opus). - Set
HF_HOME="$TMPDIR/hf"so the model download (about 330 MB fp32, 90 MB q8) lands in scratch. The first run needs network; later runs are offline. - Commit only the encoded files and a generated lookup table, never WAV, caches or
node_modules. - Label the output as synthetic speech in the generated table's header.