Linux text to speech: natural offline TTS from the terminal
On Linux, text to speech usually means espeak or Festival: fast, free and robotic. Neural voices sound like people, but most of them live in the cloud. The free SuperClonica engine brings a neural model, Supertonic 3, to your Linux machine: it runs offline on an ordinary processor and speaks 31 languages.
This guide shows how to install it in a virtual environment, voice text from the terminal, read the selected text aloud with a keyboard shortcut and choose voices.
What you need
Unlike espeak or Festival, this is a neural model, so speech sounds natural, and it still needs no internet after the first run.
- A modern 64-bit Linux distribution with Python 3.10 or newer.
- About 400 MB of disk space for the Supertonic 3 model, downloaded once.
- No graphics card: an NVIDIA GPU only makes it faster.
- A voice: the ten built-in voices M1 to M5 and F1 to F5, or a JSON file from the catalog.
Install in a virtual environment
Many distributions no longer allow pip to install into the system Python, so use a virtual environment: python3 -m venv ~/.venvs/tts && ~/.venvs/tts/bin/python -m pip install superclonica-cpu. The command is then ~/.venvs/tts/bin/superclonica; add that folder to your PATH or create an alias. With an NVIDIA graphics card, install superclonica-gpu-cuda instead: pip brings CUDA and cuDNN itself.
Voice text from the terminal
The model downloads on the first run; after that the engine works without a network.
- One phrase: superclonica --text "Hello from Linux." --voice F1 --lang en --output hello.wav && aplay hello.wav.
- A whole file: --text-file article.txt instead of --text; long texts are split at natural pauses and joined into one WAV file.
- Play the result with aplay, paplay or pw-play, depending on your sound system.
- On a busy machine, limit the processor threads with --threads 4.
Read selected text with a hotkey
Save a small script and bind it to a keyboard shortcut in your desktop settings: xclip -o > /tmp/sel.txt (on Wayland: wl-paste -p > /tmp/sel.txt), then superclonica --text-file /tmp/sel.txt --voice F1 --lang en --output /tmp/sel.wav && aplay /tmp/sel.wav. Select text in any window, press the shortcut, and the engine reads it aloud. Change --lang and the voice to read other languages.
Voices and a server
Every voice in the SuperClonica catalog has a page where you can voice a phrase of 30 to 100 characters for free online. Free voices download without an account, and paid ones are bought once and stay yours as a JSON file that you pass with --voice. For other programs on your network, the superclonica/superclonica image on Docker Hub runs the same engine as an HTTP server.