gtts
Google Text-to-Speech (gTTS) for converting text to audio
Install / Use
npx skills add benchflow-ai/skillsbench --skill gttsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
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.
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.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| gtts (this skill)by benchflow-ai | 83 | 1.8k | 2mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 86.9k | 15d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.2k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 44.6k | 1d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | today | CLAUDE.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.
Skill content
View source on GitHubname: 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:
- Split text into chunks at sentence boundaries
- Generate audio for each chunk using gTTS
- 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=Falsefor 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
Agent-Reach
86.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
44.6kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
