Guide
Make a voice on your own computer
Three free tools that turn text into speech without a subscription: Piper, Kokoro and Chatterbox. Pick one, run a few commands, and you have a voice file.
Which one should I try?
They all do text to speech. They differ in effort, quality and what they can do.
Piper
Easiest and fastest. Runs locally, many voices and languages, no voice cloning. A good first try.
Easy
Kokoro
Small and natural. An 82 million parameter model that is quick, with ready-made voices. No voice cloning.
Medium
Chatterbox
Most capable. Many languages and voice cloning from a short clip. Heavier, and a graphics card helps.
Technical
The paid tool they stand in for is ElevenLabs. They do not match its polish in every language, so listen to a sample for your language before you commit. Details on each: Piper, Kokoro, Chatterbox.
Before you start
You need
- Python. All three install with
pip. Chatterbox was developed and tested on Python 3.11. - A terminal. Windows PowerShell, macOS Terminal or a Linux shell.
- Patience on the first run. The first time, the program downloads its model files.
A tip
- Use a virtual environment. It keeps each tool's packages in their own folder, so they do not clash. Create one with
python -m venv voiceand activate it before you install. - Try with a short text first. One sentence is enough to check it works.
Piper: your first voice in three commands
- Install.
pip install piper-tts - Download a voice. This example downloads an American English voice to the current folder. To see all voices, run the same command without a name.
python3 -m piper.download_voices en_US-lessac-medium - Make a sound file.
This writespython3 -m piper -m en_US-lessac-medium -f test.wav -- 'This is a test.'test.wav. On Windows,pythonmay work wherepython3does not.
The command line reloads the model each time, so it is slow for many files. For repeated use, Piper has a web server mode. Add --cuda for GPU speed (it needs the onnxruntime-gpu package).
MODEL_CARD file with its own license, and some voices have restrictive licenses. Check the voice you pick before you publish or sell anything. Also, the project is currently looking for maintainers, so check how active it is. Piper on this site.Kokoro: a small model that sounds natural
- Install the package.
pip install "kokoro>=0.9.4" soundfile - Install espeak-ng. Kokoro uses it for some words and languages. On Windows: open the espeak-ng releases page on GitHub, download the latest
.msifile and run it. On Linux, install theespeak-ngpackage, for example withsudo apt-get install espeak-ng. - Run this script. Save it as
say.pyand runpython say.py. Theameans American English, andaf_heartis one of the ready-made voices.from kokoro import KPipeline import soundfile as sf pipeline = KPipeline(lang_code='a') text = 'Hello, this is a short test of Kokoro.' for i, (gs, ps, audio) in enumerate(pipeline(text, voice='af_heart')): sf.write(f'{i}.wav', audio, 24000)
Other language codes from the project: b British English, e Spanish, f French, h Hindi, i Italian, p Brazilian Portuguese, j Japanese and z Mandarin (these two need an extra package). Dutch is not in the project's list. Make sure the language code matches the voice.
Chatterbox: many languages and voice cloning
- Install.
pip install chatterbox-tts - Run this script. Use
cudaif you have an NVIDIA graphics card,mpson an Apple Silicon Mac, orcpuif you have neither (slower).import torchaudio as ta from chatterbox.tts import ChatterboxTTS model = ChatterboxTTS.from_pretrained(device='cuda') wav = model.generate('Hello, this is a short test of Chatterbox.') ta.save('test.wav', wav, model.sr) - To clone a voice, pass a short reference recording. The project's own example does it like this:
wav = model.generate(text, audio_prompt_path='your_ref_clip.wav')
The multilingual model covers 23+ languages. Match the reference clip to the language you generate, otherwise the accent of the clip can carry over.
Good to know
Only clone voices you have permission to use. Cloning someone's voice without their consent can cause real harm and can be illegal. Use your own voice, or get a clear yes.
Check the license of the voice or model. The code and the voices can have different rules, especially if you plan to sell or publish what you make.
Say it was made by AI where it matters. If listeners could think a real person recorded it, tell them it is synthetic.
New to running things yourself? Start here. Prefer video models? Read the ComfyUI guide.