---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "TTS Voiceover and Foley Stem Batch Skill"
description: "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)."
canonical: "https://framesfield.com/skills/openai-elevenlabs-narration-batch-skill"
---

# TTS Voiceover and Foley Stem Batch Skill

> 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).

- **Canonical URL:** https://framesfield.com/skills/openai-elevenlabs-narration-batch-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/openai-elevenlabs-narration-batch-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** Deepgram Aura-2 / Cartesia Sonic / ElevenLabs
- **License:** MIT
- **Last Verified:** 2026-11-30
- **Source Reference:** https://developers.deepgram.com/docs/tts-models

## Setup & Install

```bash
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

```

## Copyable Asset (SKILL.md)

````markdown
---
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.
````

## Example Input

```text
"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."
```

## Expected Output

```text
- 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`).
```

## 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

## Known Limits

- 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

## Implementation Notes

## Complete your silent-video-to-voiced-spot pipeline

Feed the generated `48 kHz` WAV stems straight into [Workflow 08: Silent AI Video to Voiced Spot with ElevenLabs & FFmpeg Mix](/workflows/silent-video-to-voiced-spot-pipeline) and compare active REST voice rates on [Deepgram Aura-2 vs. ElevenLabs TTS](/specs/compare/deepgram-aura-2-vs-elevenlabs-tts) and [Cartesia Sonic vs. ElevenLabs TTS](/specs/compare/cartesia-sonic-vs-elevenlabs-tts).
