# Text to speech in Python: offline, free and with natural voices

Updated 2026-10-22

Python has several ways to turn text into speech. Some libraries read with the robotic voices of the operating system, some send your text to an online service, and some run a neural model on your own computer. The last kind now sounds close to a human and still works without internet.

This guide compares the options and then shows working code for the SuperClonica engine, a pip package built on the open Supertonic 3 model: installation, a first script, custom voices, long texts and a local HTTP API in Docker. The engine is ours, so we say where something is.

## Ways to do text to speech in Python

Before you choose a library, decide two things: whether your text may leave the computer, and how natural the voice has to sound.

- pyttsx3 drives the speech engine built into the system: SAPI5 on Windows, NSSpeechSynthesizer on macOS and eSpeak on Linux. It works offline and installs in seconds, but the voices sound robotic and differ from one machine to another.
- gTTS sends the text to the speech service of Google Translate and saves an MP3. It sounds clearer, but it needs internet, offers languages and accents rather than voices, and is an unofficial interface that can stop working.
- Cloud APIs from Google, Amazon, Microsoft or ElevenLabs sound very good, but they need an account and a key, are paid per character and send every text to the provider.
- Local neural models such as Supertonic 3, Kokoro and Piper run on your own CPU or GPU. After a one-time model download they work offline, cost nothing per character and sound far more natural than system voices. Our comparison pages cover them in detail.

## Install the SuperClonica engine

The engine is one pip package in two builds. For any CPU on Windows, macOS or Linux with Python 3.10 or newer: python -m pip install superclonica-cpu. For an NVIDIA GPU on Windows or Linux with Python 3.11 or newer: python -m pip install superclonica-gpu-cuda. Install only one of them per environment; both provide the same superclonica module.

The GPU build brings CUDA and cuDNN through pip, so the only system requirement is an NVIDIA driver with CUDA 12 support; without a working GPU it falls back to the CPU. On the first run the Supertonic 3 model, about 385 MB, is downloaded once into ~/.cache/supertonic3. Set SUPERTONIC_CACHE_DIR to keep it elsewhere.

## Your first script

Import the engine, synthesize a phrase and save it: from superclonica import Superclonica, then tts = Superclonica(), audio, sample_rate = tts.synthesize("Hello! This voice runs on my own computer.", voice="F1", lang="en", seed=7) and tts.save("hello.wav", audio). The model comes with ten voices, M1 to M5 and F1 to F5, which need no extra files.

Create the engine once and reuse it: loading takes a few seconds, while each later phrase takes a fraction of a second. In our measurements the median short phrase took 0.12 s on an RTX 5070 Ti and 0.43 s on a Ryzen 7 5800X with four threads.

## Use a custom voice

A Supertonic 3 voice is a JSON file of about 0.3 MB. Free voices with audio samples are in the superclonica/supertonic-voices repository on GitHub, and the SuperClonica catalog has 170+ more, from game characters to narrators, each with a free online demo.

Pass the file instead of a preset name: tts.synthesize("Good morning!", voice="ciri.json", lang="en", seed=7). From the command line: superclonica --text "Good morning!" --voice ciri.json --lang en --output morning.wav. Every voice speaks all 31 languages of the model; set lang to the language of the text, for example de, es, ja or ru. Chinese is not supported.

## Long texts, dialogues and file formats

A few options cover most real projects.

- A long text, such as a chapter, goes into one call: the engine splits it into natural pieces of at most 160 characters, which keeps words from being repeated or swallowed.
- normalize=True evens the loudness to −18 LUFS, which helps when you join many files.
- tts.synthesize_batch() voices several lines at once, each with its own voice, for example the lines of a dialogue; the results keep the input order.
- The same text, voice and seed give the same audio again, so you can redo one line without changing the rest.
- Numbers are spoken as words, common chat abbreviations are spelled out, and emoji or unknown symbols are cleaned up instead of causing an error.
- tts.save() writes WAV, FLAC or OGG, chosen by the file extension.

## Text to speech as a local HTTP API

If the program that needs speech is not written in Python, run the engine in Docker: docker run -d -p 8000:8000 -v superclonica-models:/models superclonica/superclonica:cpu, or the cuda tag with --gpus all on an NVIDIA GPU. The model downloads into the volume on the first start.

Send POST /synthesize with JSON that holds the text, the language and the content of the voice file, and a WAV comes back. A voice is about 0.3 MB, so build the request in a file and send it with curl -d @request.json.

## Licenses and responsible use

Supertonic 3 is released under OpenRAIL-M, a royalty-free license with a list of prohibited uses rather than a non-commercial clause. Do not use speech to impersonate someone without consent, to deceive or to harass, and say that audio is machine-generated where that matters.

Some catalog voices are inspired by well-known people. They are not their real voices, so do not present such audio as their real words.

## More guides

- [How to convert text to speech offline on your computer](https://superclonica.com/en/guides/offline-text-to-speech)
- [Voice cloning: how to get a voice that sounds like a recording](https://superclonica.com/en/guides/voice-cloning)
- [The best free text-to-speech models for local use in 2026](https://superclonica.com/en/guides/best-free-tts-models)
- [Text to speech for videos, audiobooks, games and apps](https://superclonica.com/en/guides/text-to-speech-for-videos)
- [Supertonic 3 voices: where to get custom voices and how to use them](https://superclonica.com/en/guides/supertonic-3-voices)
- [Self-hosted text-to-speech API in Docker](https://superclonica.com/en/guides/text-to-speech-api-docker)

## Text to speech and comparisons

- [Text-to-speech that runs on your own computer](https://superclonica.com/en/text-to-speech)
- [Supertonic vs SuperClonica: same model, faster and cleaner](https://superclonica.com/en/compare/supertonic)
- [Fish Audio and Fish Speech vs SuperClonica](https://superclonica.com/en/compare/fish-audio)
- [OmniVoice vs SuperClonica: more languages or more speed](https://superclonica.com/en/compare/omnivoice)
- [Qwen3-TTS vs SuperClonica for local text-to-speech](https://superclonica.com/en/compare/qwen3-tts)
- [VoxCPM 2 vs SuperClonica: studio sound or CPU speed](https://superclonica.com/en/compare/voxcpm)
- [F5-TTS vs SuperClonica: zero-shot cloning or fast CPU speech](https://superclonica.com/en/compare/f5-tts)
- [An offline alternative to ElevenLabs](https://superclonica.com/en/compare/elevenlabs)
- [Kokoro TTS vs SuperClonica: two small models for local speech](https://superclonica.com/en/compare/kokoro)
- [Piper TTS vs SuperClonica: tiny devices or custom voices](https://superclonica.com/en/compare/piper)
- [Coqui XTTS-v2 vs SuperClonica: a Coqui TTS alternative](https://superclonica.com/en/compare/xtts)
- [Chatterbox TTS vs SuperClonica: instant cloning or a trained voice file](https://superclonica.com/en/compare/chatterbox)

## Frequently asked questions

### How do I convert text to speech in Python without internet?

Use a library that runs on your computer: pyttsx3 for the system voices, or a local neural model for natural speech. With the SuperClonica engine, install superclonica-cpu with pip; after the model is downloaded once, everything runs offline.

### Which is better, pyttsx3 or gTTS?

pyttsx3 works offline with the system voices, which sound robotic; gTTS sounds clearer but sends the text to Google over the internet. A local neural model such as Supertonic 3 gives natural speech without internet.

### Do I need a GPU?

No. superclonica-cpu runs on an ordinary CPU on Windows, macOS and Linux, and a short phrase takes well under a second. An NVIDIA GPU is several times faster and helps with large volumes.

### Can I use the generated speech commercially?

The Supertonic 3 license, OpenRAIL-M, is royalty-free and has no non-commercial clause; it lists prohibited uses such as impersonating people without consent. Voices inspired by well-known people must not be presented as their real words.

- [Browse voices for your Python project](https://superclonica.com/en/explore)
- [Install the SuperClonica engine](https://superclonica.com/en/superclonica)

## Sources

- [pyttsx3 (PyPI)](https://pypi.org/project/pyttsx3/)
- [gTTS documentation](https://gtts.readthedocs.io/)
- [SuperClonica engine (PyPI)](https://pypi.org/project/superclonica-cpu/)
- [Supertonic 3 model card (Hugging Face)](https://huggingface.co/supertone-oss-archive/supertonic-3)
- [Free Supertonic 3 voices (GitHub)](https://github.com/superclonica/supertonic-voices)
- [SuperClonica Docker image (Docker Hub)](https://hub.docker.com/r/superclonica/superclonica)
- [SuperClonica](https://superclonica.com/en/)
- [AI voice catalog for text to speech](https://superclonica.com/en/explore)
- [Custom voice commissions for Supertonic 3](https://superclonica.com/en/requests)
- [How it works: voices, local speech, training](https://superclonica.com/en/guide)
- [Install the faster Supertonic 3 engine](https://superclonica.com/en/superclonica)
- [About us: speech synthesis enthusiasts](https://superclonica.com/en/about)
- [Contacts, support and voice complaints](https://superclonica.com/en/contacts)
- [Privacy policy: what data we keep](https://superclonica.com/en/privacy)
- [Terms of use: rules for buyers and authors](https://superclonica.com/en/terms)
- [Text to speech](https://superclonica.com/en/text-to-speech)
