Skip to content
Skillv1.0.0

tts-generation

AI text-to-speech generation using OpenAI TTS, ElevenLabs, and Google TTS backends. Converts text to audio files with voice selection, speed control, and format options.

by oimiragieo(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from oimiragieo/agent-studio (.claude/skills/tts-generation/SKILL.md). Install upstream with npx skills add oimiragieo/agent-studio --skill tts-generation. Copyright stays with the author.

TTS Generation

Overview

Generate speech audio from text using AI backends.

  • OpenAI TTStts-1 (low latency) / tts-1-hd (studio quality), 6 voices, 57 languages
  • ElevenLabseleven_turbo_v2 / eleven_multilingual_v2, cloneable voices, 29 languages
  • Google TTSgTTS Python library, 40+ languages, free tier

Backend Comparison

Feature OpenAI TTS ElevenLabs Google TTS
Quality High Highest Medium
Latency Low (tts-1) Medium Low
Cost ~$15/1M chars ~$22/1M chars Free (limited)
Voices 6 preset Cloneable 40+ languages
Max chars 4096/request Unlimited ~5000/request
Streaming Yes Yes No

Quick Start

OpenAI TTS (Recommended)

from pathlib import Path
from openai import OpenAI

client = OpenAI()

response = client.audio.speech.with_streaming_response.create(
    model="tts-1-hd",  # tts-1 for speed, tts-1-hd for quality
    voice="nova",       # alloy | echo | fable | onyx | nova | shimmer
    input="Hello world",
    speed=1.0,          # 0.25 to 4.0
)
response.stream_to_file(Path("output.mp3"))

ElevenLabs

from elevenlabs import ElevenLabs

client = ElevenLabs(api_key="YOUR_API_KEY")
audio = client.text_to_speech.convert(
    voice_id="21m00Tcm4TlvDq8ikWAM",  # Rachel
    model_id="eleven_turbo_v2",
    text="Hello world",
    output_format="mp3_44100_128",
)
with open("output.mp3", "wb") as f:
    for chunk in audio:
        f.write(chunk)

Google TTS (Free)

from gtts import gTTS
gTTS(text="Hello world", lang="en", slow=False).save("output.mp3")

Long-Text Chunking

For text exceeding limits, split at sentence boundaries and concatenate with pydub. Pattern: iterate sentences, accumulate into current until max_chars (4000), flush to chunks on overflow.

Output Formats

mp3 (general), opus (streaming), flac (lossless archival), wav (editing), pcm (raw pipeline).

Installation

pip install openai elevenlabs gtts pydub
export OPENAI_API_KEY="sk-..."
export ELEVENLABS_API_KEY="..."

Agent Usage Pattern

  • OpenAI TTS: documentation/demos narration
  • ElevenLabs: cloned voices or highest quality
  • Google TTS: multilingual free-tier
  • Chunk at sentence boundaries; cache by content hash

Related Skills

  • transcription — Reverse: audio to text via Whisper
  • ai-ml-expert — Advanced ML pipeline integration

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern → .claude/context/memory/learnings.md
  • Issue found → .claude/context/memory/issues.md
  • Decision made → .claude/context/memory/decisions.md

ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/oimiragieo-agent-studio-tts-generation/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

oimiragieo-agent-studio-tts-generation.ocm.jsonjson
{
  "ocm": "1",
  "id": "oimiragieo-agent-studio-tts-generation",
  "kind": "skill",
  "name": "tts-generation",
  "description": "AI text-to-speech generation using OpenAI TTS, ElevenLabs, and Google TTS backends. Converts text to audio files with voice selection, speed control, and format options.",
  "publisher": "oimiragieo",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "tts",
      "text-to-speech",
      "audio",
      "openai",
      "elevenlabs",
      "google-tts",
      "voice",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "AI text-to-speech generation using OpenAI TTS, ElevenLabs, and Google TTS backends. Converts text to audio files with voice selection, speed control, and format options."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/oimiragieo/agent-studio",
      "path": ".claude/skills/tts-generation/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/oimiragieo/agent-studio/blob/HEAD/.claude/skills/tts-generation/SKILL.md",
      "key": "oimiragieo/agent-studio/.claude/skills/tts-generation/SKILL.md"
    }
  },
  "instructions": "# TTS Generation\n\n## Overview\n\nGenerate speech audio from text using AI backends.\n\n- **OpenAI TTS** — `tts-1` (low latency) / `tts-1-hd` (studio quality), 6 voices, 57 languages\n- **ElevenLabs** — `eleven_turbo_v2` / `eleven_multilingual_v2`, cloneable voices, 29 languages\n- **Google TTS** — `gTTS` Python library, 40+ languages, free tier\n\n## Backend Comparison\n\n| Feature   | OpenAI TTS    | ElevenLabs    | Google TTS     |\n| --------- | ------------- | ------------- | -------------- |\n| Quality   | High          | Highest       | Medium         |\n| Latency   | Low (tts-1)   | Medium        | ",
  "cost": {
    "context_tokens": 741
  }
}

Fetch it by URL: GET /api/v1/registry/oimiragieo-agent-studio-tts-generation/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.