← all repositories
pndurette/gTTS

Google Translate's voice, smuggled out as a Python library

A decade-old wrapper that turns Google's undocumented speech endpoint into MP3s, for when you need TTS without the cloud bill.

2.6k stars Python Image · Video · Audio
gTTS
Not currently ranked — collecting fresh signals.
star history

What it does

gTTS is a Python library and CLI that hits the undocumented speech endpoint inside Google Translate and writes the resulting MP3 to a file, a bytestream, or stdout. It handles the tokenization and text chunking so you can feed it arbitrarily long text without losing intonation on abbreviations or decimals.

The interesting bit

The project survives by reverse-engineering a consumer web feature, not by using Google’s official Cloud Text-to-Speech API. That means no API keys, no billing, and no SLA — just the quiet hope that Google doesn’t shuffle its internal endpoints again.

Key highlights

  • CLI and module interfaces; gtts-cli 'hello' --output hello.mp3 is the whole incantation
  • Customizable sentence tokenizer for long-text handling without robotic pauses
  • Text pre-processor hooks for pronunciation tweaks (e.g., forcing how acronyms sound)
  • Outputs to files, file-like objects, or stdout for piping into other tools
  • MIT licensed, actively maintained since 2014

Caveats

  • Explicitly not affiliated with Google; upstream breaking changes “can occur without notice”
  • Uses an undocumented endpoint, so reliability is best-effort
  • Different feature set and voice quality from the official Google Cloud Text-to-Speech product

Verdict

Worth a look if you need quick, free TTS for a side project, accessibility script, or audio pipeline prototype. Skip it if you need guaranteed uptime, voice customization, or anything that might end up in production without a fallback plan.

Frequently asked

What is pndurette/gTTS?
A decade-old wrapper that turns Google's undocumented speech endpoint into MP3s, for when you need TTS without the cloud bill.
Is gTTS open source?
Yes — pndurette/gTTS is open source, released under the MIT license.
What language is gTTS written in?
pndurette/gTTS is primarily written in Python.
How popular is gTTS?
pndurette/gTTS has 2.6k stars on GitHub.
Where can I find gTTS?
pndurette/gTTS is on GitHub at https://github.com/pndurette/gTTS.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.