agentleFS
captjtcaptjt/skill-tts/skills/tts/SKILL.md

tts

Skill1 starsChanged 28 days agoMITView on GitHub

Text-to-speech for voiceovers and spoken output. Renders narration for product, feature, and demo videos as per-scene audio files with exact durations, timing offsets, and captions, and speaks text aloud. Supports the built-in macOS/Linux voice, local Kokoro, OpenAI, ElevenLabs, Gemini, Cartesia, and Deepgram. Use when the user wants a voiceover, narration, or audio for a video or screencast, wants something read aloud or announced, wants an audio file (.wav/.mp3/.m4a), wants to compare or choose voices, or wants to set up TTS providers and API keys.

  • Reads credentials

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Video Generation, VLM and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • huang-x-hSkill

    Video Generation

    Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.

    Also in 6 projects that use this

  • huang-x-hSkill

    VLM

    Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

    Also in 6 projects that use this

  • dav-niu474Skill

    gift-evaluator

    The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

    Also in 5 projects that use this

  • dav-niu474Skill

    Podcast Generate

    Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

    Also in 5 projects that use this

  • +2 more from huang-x-h
  • +6 more from dav-niu474

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the launcher at ${CLAUDE_SKILL_DIR}/scripts/tts, which is scripts/tts in this skill's directory.

    line 9
  2. Very specific:

    Run each tts command as its own Bash call.

    line 11
  3. Distinctive:

    Put one segment per scene or shot, and reuse the video's scene ids so audio and visuals line up:

    line 21
  4. Very specific:

    Placing audio: put each segment's file at its scene's start time, or use voiceover.wav as a single track with start/end as offsets.

    line 74
  5. Distinctive:

    Summarize; don't recite: Use two to four spoken sentences unless asked to read the full text.

    line 100
  6. Distinctive:

    Describe code in words: instead of reading it. Markdown and code blocks are stripped automatically.

    line 101
  7. Very specific:

    Use the configured defaults (tts config show).

    line 106
  8. Distinctive:

    Never send secrets, credentials, or private data to a cloud provider.

    line 108
  9. Very specific:

    Kokoro not reachable: start it with docker run -d --name kokoro -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:v0.9.0.

    line 118

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Text to speech

Run the launcher at ${CLAUDE_SKILL_DIR}/scripts/tts, which is scripts/tts in this skill's directory. Below it's written as tts. The first run downloads a ~7 MB binary and checks its SHA-256 before running it.

Run each tts command as its own Bash call. Don't chain it with ;, &&, or pipes, so it stays covered by the skill's pre-approved permission.

There are two jobs:

  • Voiceovers for videos: tts render. Produces files plus a timing manifest for the rest of the video pipeline.
  • Speaking aloud: tts "text". Plays through the speakers and returns immediately.

Voiceovers for videos

1. Write a script

Put one segment per scene or shot, and reuse the video's scene ids so audio and visuals line up:

{
  "provider": "elevenlabs",
  "voice": "JBFqnCBsd6RMkjVDRZzb",
  "instructions": "warm, confident product narrator",
  "pause": 0.5,
  "segments": [
    {"id": "01-intro",   "text": "Meet the new Insights dashboard."},
    {"id": "02-filters", "text": "Filter any chart in one click: by team, by service, or by release."},
    {"id": "03-alerts",  "text": "Set an alert once, and we'll tell you the moment a metric drifts.", "pause": 1.0},
    {"id": "04-outro",   "text": "Insights is available today, on every plan."}
  ]
}
  • Top-level fields (provider, voice, model, instructions, speed, pause) apply to every segment. Each segment can override voice, model, instructions, speed, and pause, which is the silence after it in the combined track.
  • Keep one provider and voice for the whole video so it sounds like one narrator.
  • Write for the ear: short sentences, numbers as spoken ("forty percent", "version two"), no markdown. If a product name is mispronounced, spell it phonetically in text.
  • Choosing a provider and voice. If the script doesn't set a provider and tts config show has no voiceover_provider, ask the user which provider and voice to use. To let them compare, render short samples with tts -o sample-NAME.wav -p PROVIDER -v VOICE "One line of the script.". Offer to save their choice with tts config set voiceover_provider NAME and tts config set NAME.voice VOICE. Kokoro and system are free and local; the rest are paid. ElevenLabs, OpenAI with instructions, and Gemini sound the most natural.

2. Render

"${CLAUDE_SKILL_DIR}/scripts/tts" render script.json -o voiceover/

This writes:

  • voiceover/<id>.wav for each segment, with leading and trailing silence trimmed so durations are exact.
  • voiceover/voiceover.wav, all segments joined with their pauses.
  • voiceover/voiceover.srt, captions.
  • voiceover/manifest.json, which is also printed to stdout:
{"provider": "elevenlabs", "sample_rate": 24000, "channels": 1, "duration": 17.08,
 "combined": {"file": "/abs/voiceover/voiceover.wav", "duration": 17.08},
 "captions": "/abs/voiceover/voiceover.srt",
 "segments": [{"id": "01-intro", "file": "/abs/voiceover/01-intro.wav", "duration": 3.872,
               "start": 0, "end": 3.872, "text": "...", "voice": "...", "cached": false}, ...]}

Render options:

  • --format mp3|m4a sets the combined track's format.
  • --no-combine writes only the per-segment files.
  • -p/-v/-i/-s set defaults the script doesn't specify.
  • --jobs N sets parallelism.

render uses each provider's highest-fidelity model unless one is set: eleven_multilingual_v2 and gemini-3.8-flash-tts.

3. Use the timings

  • Scene lengths: each scene should last at least its segment's duration. Add a beat of breathing room, or extend the scene to match.
  • Placing audio: put each segment's file at its scene's start time, or use voiceover.wav as a single track with start/end as offsets.
  • Muxing with ffmpeg:
    • The whole track: ffmpeg -i video.mp4 -i voiceover/voiceover.wav -map 0:v -map 1:a -c:v copy -c:a aac -shortest out.mp4
    • One segment at 4.47 s: add the input -i voiceover/02-filters.wav, then -filter_complex "[1]adelay=4470:all=1[a]" -map 0:v -map "[a]".

4. Iterate

Edit the script and run the same command again. Segments whose text, voice, model, style, and speed are unchanged are reused from the last render ("cached": true). Only the changed segments are re-rendered and billed. Use --force to re-render everything. If some segments fail, the others are kept, and re-running retries only the failures.

Speaking aloud

"${CLAUDE_SKILL_DIR}/scripts/tts" "The build passed and all 214 tests are green."
"${CLAUDE_SKILL_DIR}/scripts/tts" <<'EOF'
Longer text, or anything with quotes, goes on stdin.
EOF

This returns once audio is playing, and playback continues in the background. New speech interrupts current speech; -q queues it instead, and tts stop silences everything.

Other options:

  • -p provider, -v voice, -i "style", -s speed.
  • -w waits for playback to finish.
  • -o FILE [--json] writes one file instead of playing. --json prints its duration and path.

When speaking:

  • Summarize; don't recite. Use two to four spoken sentences unless asked to read the full text.
  • Describe code in words instead of reading it. Markdown and code blocks are stripped automatically.
  • Keep notifications short, and use -q for a series of them.

Providers, cost, and privacy

  • Use the configured defaults (tts config show). Pass -p only when the user or the script names a provider.
  • system and kokoro stay on this machine and are free. The other providers send the text to that company and bill the user's account. Never change the default provider without asking.
  • Never send secrets, credentials, or private data to a cloud provider.
  • Paid providers refuse more than 20,000 new characters per command. Shorten the text, or pass --max-chars N if the user wants it all.

Setup and troubleshooting

  • tts doctor shows the audio output, the default provider, and which providers are ready.
  • tts providers and tts voices -p NAME [filter] list providers and voices.
  • tts config set KEY VALUE sets defaults. Keys are provider, voiceover_provider, max_chars, and NAME.voice|model|speed|instructions|base_url.
  • Missing API key: tell the user to set the env var (e.g. ELEVENLABS_API_KEY) or run tts auth set elevenlabs in their own terminal. Never ask the user to paste a key into the chat, and never put one on a command line.
  • Untested cloud providers: openai, gemini, cartesia, and deepgram haven't been tested against their live APIs yet. Only system, kokoro, and elevenlabs have. If one of them fails with an error about the request itself (an unknown field, invalid parameter, or unexpected response), it's probably a bug in this skill, not something the user did. Show the user the exact error, suggest reporting it at github.com/captjt/skill-tts/issues, and offer kokoro or system as a fallback. Don't keep retrying with guessed parameters. Auth (401/403) and quota (429) errors are the user's to fix as usual.
  • Kokoro not reachable: start it with docker run -d --name kokoro -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:v0.9.0.
  • No audio device (SSH, containers): use render or -o; they don't need speakers.

Voices, models, and options for each provider are in references/providers.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.