SkillAgentSearch skills...

gtts

Google Text-to-Speech (gTTS) for converting text to audio

Install / Use

npx skills add benchflow-ai/skillsbench --skill gtts

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

83/100

Supported Platforms

Universal

Our assessment of gtts

gtts scores 83/100 on our quality scale, 2372nd of 4,258 Development & Engineering skills we index.

Its SKILL.md is 3.3 KB long, well organised into 16 sections with 5 code examples: a solid amount of guidance for an agent.

With 1,813 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
26/30
Structure
20/20
Description
8/15
Adoption
14/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so gtts is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

gtts compared with similar skills

All 4 of these similar skills score higher than gtts; compare them before choosing.

SkillScoreStarsUpdatedFormat
gtts (this skill)by benchflow-ai831.8k2mo agoSKILL.md
Agent-Reachby Panniantong10086.9k15d agoCLAUDE.md
headroomby headroomlabs-ai10074.2ktodayCLAUDE.md
ai-job-searchby MadsLorentzen10044.6k1d agoCLAUDE.md
claude-howtoby luongnv8910041.7ktodayCLAUDE.md

Frequently asked questions

How do I install gtts?
Run npx skills add benchflow-ai/skillsbench --skill gtts. The install tabs above show the steps for each supported agent.
Which AI agents does gtts work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is gtts safe to use?
It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is gtts still maintained?
The repository was last updated about 2 months ago, so gtts is actively maintained.

name: gtts description: "Google Text-to-Speech (gTTS) for converting text to audio. Use when creating audiobooks, podcasts, or speech synthesis from text. Handles long text by chunking at sentence boundaries and concatenating audio segments with pydub."

Google Text-to-Speech (gTTS)

gTTS is a Python library that converts text to speech using Google's Text-to-Speech API. It's free to use and doesn't require an API key.

Installation

pip install gtts pydub

pydub is useful for manipulating and concatenating audio files.

Basic Usage

from gtts import gTTS

# Create speech
tts = gTTS(text="Hello, world!", lang='en')

# Save to file
tts.save("output.mp3")

Language Options

# US English (default)
tts = gTTS(text="Hello", lang='en')

# British English
tts = gTTS(text="Hello", lang='en', tld='co.uk')

# Slow speech
tts = gTTS(text="Hello", lang='en', slow=True)

Python Example for Long Text

from gtts import gTTS
from pydub import AudioSegment
import tempfile
import os
import re

def chunk_text(text, max_chars=4500):
    """Split text into chunks at sentence boundaries."""
    sentences = re.split(r'(?<=[.!?])\s+', text)
    chunks = []
    current_chunk = ""

    for sentence in sentences:
        if len(current_chunk) + len(sentence) < max_chars:
            current_chunk += sentence + " "
        else:
            if current_chunk:
                chunks.append(current_chunk.strip())
            current_chunk = sentence + " "

    if current_chunk:
        chunks.append(current_chunk.strip())

    return chunks


def text_to_audiobook(text, output_path):
    """Convert long text to a single audio file."""
    chunks = chunk_text(text)
    audio_segments = []

    for i, chunk in enumerate(chunks):
        # Create temp file for this chunk
        with tempfile.NamedTemporaryFile(suffix='.mp3', delete=False) as tmp:
            tmp_path = tmp.name

        # Generate speech
        tts = gTTS(text=chunk, lang='en', slow=False)
        tts.save(tmp_path)

        # Load and append
        segment = AudioSegment.from_mp3(tmp_path)
        audio_segments.append(segment)

        # Cleanup
        os.unlink(tmp_path)

    # Concatenate all segments
    combined = audio_segments[0]
    for segment in audio_segments[1:]:
        combined += segment

    # Export
    combined.export(output_path, format="mp3")

Handling Large Documents

gTTS has a character limit per request (~5000 chars). For long documents:

  1. Split text into chunks at sentence boundaries
  2. Generate audio for each chunk using gTTS
  3. Use pydub to concatenate the chunks

Alternative: Using ffmpeg for Concatenation

If you prefer ffmpeg over pydub:

# Create file list
echo "file 'chunk1.mp3'" > files.txt
echo "file 'chunk2.mp3'" >> files.txt

# Concatenate
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp3

Best Practices

  • Split at sentence boundaries to avoid cutting words mid-sentence
  • Use slow=False for natural speech speed
  • Handle network errors gracefully (gTTS requires internet)
  • Consider adding brief pauses between chapters/sections

Limitations

  • Requires internet connection (uses Google's servers)
  • Voice quality is good but not as natural as paid services
  • Limited voice customization options
  • May have rate limits for very heavy usage

Related Skills

View on GitHub
GitHub Stars1.8k
CategoryDevelopment
Updated2mo ago
Forks368

Languages

PDDL

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions