Skip to content
FramesField
SKILL.md Developer / Local Tooling SKILL.md
Verified Nov 30, 2026

TTS Voiceover and Foley Stem Batch Skill

How to install this SKILL.md

Install into .claude/skills/, .cursor/skills/, or .agents/skills/ below to build automated voiceover + dry foley pipelines paired with low-cost silent video models (Runway Gen-4 Turbo, Runway Gen-4.5, Wan 2.2).

Installable SKILL.md teaching Claude Code, Cursor, and Codex how to split commercial scripts into timed per-beat voiceover WAV stems via Deepgram Aura-2 ($0.030/1k chars), Cartesia Sonic-3.6 (~$0.038/min), or ElevenLabs (v3 / Flash), generate dry spot foley SFX, lock 48 kHz PCM, and verify exact beat timing via ffprobe. Includes migration guardrails for OpenAI gpt-4o-mini-tts (retiring January 6, 2027).

Compatible agent hosts
Claude Code Cursor Codex
Target tool: Deepgram Aura-2 / Cartesia Sonic / ElevenLabs · License: MIT
  1. STEP 01
    Install the TTS & foley batch SKILL.md

    Pick Claude Code, Cursor, or Codex below to save the pure raw SKILL.md file.

  2. STEP 02
    Hand your agent a multi-beat script JSON

    Your agent prints exact character/minute cost upfront ($0.030/1k Deepgram Aura-2, $0.038/min Cartesia, or $0.04–$0.08/1k ElevenLabs) and renders uncompressed WAV stems.

  3. STEP 03
    Cut silent AI video directly to measured WAV durations

    Locks every stem to 48 kHz PCM, verifies real duration with ffprobe, and outputs exact clip timings for Runway or Wan.

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 (.claude/skills/) bash
Installs directly into .claude/skills/tts-foley-batch/SKILL.md.
mkdir -p .claude/skills/tts-foley-batch
curl -fsSL https://framesfield.com/raw/skills/openai-elevenlabs-narration-batch-skill -o .claude/skills/tts-foley-batch/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/openai-elevenlabs-narration-batch-skill.

TTS Voiceover and Foley Stem Batch Skill SKILL.md
---
name: tts-foley-batch
description: Generate timed per-beat 48kHz voiceover WAV stems and dry foley SFX via Deepgram Aura-2, Cartesia Sonic-3.6, or ElevenLabs API, enforce uncompressed 48kHz PCM mastering hygiene, log character spend, and report exact ffprobe durations before generating silent AI video clips.
---

# Timed Voiceover & Foley Stem Batch Protocol

Whenever generating narration or sound effects to pair with silent AI video (`Runway Gen-4 Turbo`, `Runway Gen-4.5`, `Alibaba Wan 2.2`), follow this deterministic "cut-to-radio" audio pipeline:

## 1. Route to a Durable REST Voice Engine (Avoid Retiring OpenAI `/v1/audio/speech`)
- **WARNING — OpenAI TTS Deprecation:** OpenAI officially deprecated `gpt-4o-mini-tts`, `tts-1`, and `tts-1-hd` on `/v1/audio/speech` with shutdown scheduled for **January 6, 2027** (pointing to `gpt-realtime-2.1-mini` on the WebSocket/WebRTC Realtime API). Do NOT build new REST batch scripts on `gpt-4o-mini-tts`.
- **Bulk explainers, Reels & pure pay-as-you-go REST -> `Deepgram Aura-2` (`$0.030/1k chars`, `~$0.024/min`):**
  - Request `encoding=linear16&container=wav&sample_rate=48000` on `POST https://api.deepgram.com/v1/speak` for native 48 kHz broadcast WAV.
- **Low-latency cloned brand voices (44 languages) -> `Cartesia Sonic-3.6` (`$5/mo` Pro, `~$0.038/min`):**
  - Request `48000 Hz` PCM WAV from `/tts/bytes` to avoid MP3 priming offset.
- **Expressive acting nuance or dry spot foley -> `ElevenLabs` (`$0.04` Flash / `$0.08` Expressive per 1k chars):**
  - Request `output_format=pcm_44100` (or `mp3_44100_192`).
  - Generate tactile spot foley separately via `POST /v1/sound-generation` with `"dry close-mic foley, zero music"` (`200 cr` auto / `40 cr/s` manual / `$0.12/min` API).

## 2. Print Character Count & Cost Before Calling Paid APIs
Count total script characters across all beats, display exact projected cost (`chars / 1000 * $0.030` Deepgram, `chars / 1000 * $0.05` Cartesia Pro, or `chars / 1000 * $0.08` ElevenLabs), and enforce SHA-256 caching on `(engine, voice, settings, text)` so repeated runs never re-bill unchanged beats.

## 3. Mandatory 48 kHz Conform & Head/Tail Pad Hygiene
ElevenLabs defaults to `44.1 kHz` (and legacy OpenAI stems output `24 kHz`). Conform EVERY stem cleanly to `48 kHz` PCM and add `0.25s` clean silence padding before concatenation:
```bash
ffmpeg -y -i raw_beat01.wav -af "aresample=48000,highpass=f=80,apad=pad_dur=0.25" -c:a pcm_s16le stems/beat01_48k.wav
```

## 4. Measure Real Beat Durations with `ffprobe`
Print an exact timing table (`Beat | Words | Actual Duration (s) | Recommended Silent Video Length`) using:
```bash
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 stems/beat01_48k.wav
```
Round each beat cleanly up to the next whole second your video model supports (Runway Gen-4 Turbo and Gen-4.5 accept any duration from `2s` to `10s`; check the allowed lengths of any other model first) so silent video cuts align seamlessly with natural vocal pauses.

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

Sample prompt / input
"Generate 3 timed voiceover stems from scripts/product-spot.json using Deepgram Aura-2 (48 kHz WAV), pad tails cleanly, and print the exact beat durations so I know how long to render each Runway Gen-4 Turbo clip."
What happens when it runs
- Prints cost preview (`210 chars ≈ $0.006`), caches hashes, synthesizes native 48 kHz Linear16 WAVs via Deepgram `/v1/speak`.
- Applies 80 Hz high-pass filter and 0.25s tail pad cleanly in FFmpeg.
- Reports exact `ffprobe` timings (`Beat 01: 5.1s -> 6s Runway Gen-4 Turbo`, `Beat 02: 5.4s -> 6s Runway Gen-4 Turbo`, `Beat 03: 2.6s -> 3s static SVG end-card`).

What you need & known limits

Requirements

  • DEEPGRAM_API_KEY, CARTESIA_API_KEY, or ELEVENLABS_API_KEY set in environment variables
  • FFmpeg and ffprobe available locally for 48 kHz conform and duration measurement

Watch out for

  • OpenAI gpt-4o-mini-tts, tts-1, and tts-1-hd on /v1/audio/speech are deprecated and shut down January 6, 2027—migrate existing scripts to Deepgram Aura-2, Cartesia Sonic, or ElevenLabs
  • ElevenLabs Free tier is non-commercial—use a paid Starter ($6/mo monthly · $5/mo annual) or paid API tier before client commercial use
  • Voice cloning requires documented speaker consent and clean echo-free source recordings

Frequently Asked Questions

Why generate voiceover stems BEFORE rendering silent AI video clips?
Knowing a spoken beat takes 5.4 seconds tells you immediately to render a 6-second Runway Gen-4 Turbo clip ($0.30) rather than a 5-second one ($0.25)—avoiding awkward voice speedups or wasted video retakes.
Why did this skill switch from OpenAI gpt-4o-mini-tts to Deepgram Aura-2 and Cartesia Sonic?
OpenAI officially deprecated gpt-4o-mini-tts, tts-1, and tts-1-hd on /v1/audio/speech with shutdown scheduled for January 6, 2027, naming WebSocket-based gpt-realtime-2.1-mini as successor. Deepgram Aura-2 ($0.030/1k chars, pure PAYG) and Cartesia Sonic-3.6 ($5/mo Pro) provide durable REST endpoints with native 48 kHz WAV output.
Use this page in AI tools or notes
raw .md