Skip to content
FramesField
SKILL.md Developer / Local Tooling SKILL.md
Verified Dec 1, 2026

Kokoro-82M Local Apache 2.0 TTS Batch Skill

How to install this SKILL.md

Install into .claude/skills/, .cursor/skills/, or .agents/skills/ to generate unlimited offline commercial narration tracks, scratch tracks, and multilingual drafts at $0.00 API spend.

Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to synthesize zero-API-cost commercial voiceovers locally using Apache 2.0 Kokoro-82M (82M params, runs on CPU or GPU), resample native 24 kHz WAV outputs to broadcast 48 kHz stereo, normalize to -14 LUFS, and emit exact scene duration manifests.

Compatible agent hosts
Claude Code Cursor Codex
Target tool: Kokoro-82M (Apache 2.0) / Python / FFmpeg · License: MIT
  1. STEP 01
    Install SKILL.md from /raw/skills/

    Choose Claude Code, Cursor, or Codex below to drop the verified YAML-frontmatter skill into your project.

  2. STEP 02
    Prepare a JSON or Markdown scene script

    Provide numbered narration lines (numbers spelled out cleanly) and preferred Kokoro voice ID (af_heart, am_michael, etc.).

  3. STEP 03
    Batch-render 48 kHz -14 LUFS stems locally

    Agent runs Apache 2.0 Kokoro-82M on CPU/GPU at $0.00, resamples 24 kHz → 48 kHz WAV, normalizes loudness, and logs exact seconds per scene.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (SKILL.md) ↓
Claude Code bash
Installs the pure SKILL.md payload directly into Claude Code:
mkdir -p .claude/skills/kokoro-local-tts-batch
curl -fsSL https://framesfield.com/raw/skills/kokoro-local-apache-tts-batch-skill \
  -o .claude/skills/kokoro-local-tts-batch/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/kokoro-local-apache-tts-batch-skill.

Kokoro-82M Local Apache 2.0 TTS Batch Skill SKILL.md
---
name: kokoro-local-tts-batch
description: Generate zero-API-cost offline commercial narration batches using Apache 2.0 Kokoro-82M on CPU or GPU, resample native 24 kHz PCM WAV to broadcast 48 kHz stereo via FFmpeg, normalize to -14 LUFS integrated (-1.0 dBTP), and write a scene timing manifest JSON for video editors or Sync Lipsync 2.0. Use when producing NDA rough cuts, faceless explainers, or high-volume narration without cloud TTS fees.
---

# Kokoro-82M Local Apache 2.0 TTS Batch Playbook

## 1. Environment Check & One-Time Setup
Verify Python 3.10+, `espeak-ng` (phonemizer), `kokoro`, `soundfile`, and `ffmpeg` before rendering:
```bash
# macOS Homebrew: brew install espeak-ng ffmpeg
# Python venv:    pip install -q kokoro soundfile
python3 -c "import kokoro, soundfile; print('kokoro ready')"
```
If the user wants zero local Python setup, fall back cleanly to fal.ai `fal-ai/kokoro/american-english` (`$0.02 / 1,000 chars`) and note the exact cost first.

## 2. Batch Render Native 24 kHz Stems per Scene
Write a clean deterministic runner reading `scenes.json` (`[{"id":"s01","voice":"af_heart","speed":1.0,"text":"..."}]`):
```python
import json, pathlib, numpy as np, soundfile as sf
from kokoro import KPipeline

out_dir = pathlib.Path("audio_raw_24k")
out_dir.mkdir(exist_ok=True)
pipe = KPipeline(lang_code="a")  # 'a' American EN, 'b' British EN, 'e' ES, 'f' FR, 'j' JA

for row in json.loads(pathlib.Path("scenes.json").read_text()):
    chunks = [audio for _, _, audio in pipe(row["text"], voice=row.get("voice", "af_heart"), speed=row.get("speed", 1.0))]
    wav = np.concatenate(chunks)
    sf.write(out_dir / f"{row['id']}.wav", wav, 24000, subtype="PCM_16")
```

## 3. Mandatory Broadcast Conform (24 kHz → 48 kHz Stereo, -14 LUFS)
Never drop raw 24 kHz mono WAV straight into a 48 kHz video timeline (prevents NLE resampling artifacts and uneven volume). Conform every scene stem with FFmpeg and log exact duration:
```bash
mkdir -p audio_master_48k
for f in audio_raw_24k/*.wav; do
  base=$(basename "$f")
  ffmpeg -y -i "$f" \
    -af "aresample=48000,pan=stereo|c0=c0|c1=c0,loudnorm=I=-14:TP=-1.0:LRA=11" \
    -c:a pcm_s16le -ar 48000 "audio_master_48k/$base"
  dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "audio_master_48k/$base")
  echo "$base -> ${dur}s (48kHz stereo -14 LUFS)"
done
```

## 4. Verification Gate
Confirm every stem exists, is non-silent, matches `sample_rate=48000` and `channels=2`, and emit `audio_manifest.json` containing scene IDs and exact durations in seconds so downstream Remotion, FFmpeg beat-sync, or Sync Lipsync 2.0 jobs align cleanly.

3. Test it right away (sample prompt & result)

Sample prompt / input
Synthesize our 6-scene documentary script in scenes.json using local Apache 2.0 Kokoro-82M (voice af_heart, speed 1.0), conform every stem to 48 kHz stereo WAV at -14 LUFS, and output audio_manifest.json with exact durations.
What happens when it runs
Rendered 6 local Kokoro-82M stems at $0.00 API cost (48 kHz stereo PCM_16, -14 LUFS).
Manifest: s01.wav (5.84s), s02.wav (6.12s), s03.wav (5.40s), s04.wav (6.31s), s05.wav (5.92s), s06.wav (5.68s) -> Total 35.27s.

What you need & known limits

Requirements

  • Python 3.10+, kokoro, soundfile, and espeak-ng installed locally (CPU or GPU; ~330 MB weights)
  • Local FFmpeg 6+ installed for 24 kHz → 48 kHz stereo resampling and -14 LUFS normalization

Watch out for

  • Kokoro-82M uses curated voice packs rather than arbitrary zero-shot voice cloning—switch to ElevenLabs TTS when cloning a specific client spokesperson
  • Spell out large numbers, currency amounts, and rare acronyms cleanly in scenes.json before synthesis

Zero-cost commercial narration without cloud uploads

For NDA client rough cuts, faceless explainer channels, and automated Remotion video pipelines, paying $0.08/1k chars on cloud TTS across dozens of script revisions adds friction and exposes unreleased scripts to third-party servers. Kokoro-82M solves both problems with an 82-million-parameter Apache 2.0 model that generates clean speech faster than real time right on your laptop CPU.

Use this skill alongside our Talking-Head Explainer & Lip-Sync Voice Swap workflow or pair it with our Faceless Explainer & Documentary Script-to-Shotlist Builder to turn a text outline into broadcast-ready 48 kHz -14 LUFS stems in one command.

Frequently Asked Questions

Why resample Kokoro-82M outputs from 24 kHz to 48 kHz before editing?
Video NLEs, FFmpeg muxers, and broadcast platforms standardize on 48 kHz audio clocks. Resampling once with FFmpeg's aresample filter alongside -14 LUFS loudness normalization keeps every clip aligned with zero pitch or clock drift.
Does Kokoro-82M require an NVIDIA GPU?
No. At 82 million parameters, Kokoro-82M runs faster than real time on Apple Silicon MacBooks and standard desktop CPUs under the permissive Apache 2.0 commercial license.
Use this page in AI tools or notes
raw .md