Machine learning text-to-speech for your terminal. Hear text read aloud by realistic voices, from a file or your clipboard.
Find a file
2025-09-03 23:34:47 +02:00
demo feat: add demo textx 2025-09-03 22:41:26 +02:00
.gitignore chore: add __pycache__ to gitignore 2025-09-03 22:14:35 +02:00
env.sh initial commit 2025-09-03 20:59:57 +02:00
README.md chore: update readme 2025-09-03 23:34:47 +02:00
requirements.txt feat: implement --device flag 2025-09-03 22:50:02 +02:00
tts.py feat: allow using all voices available 2025-09-03 22:59:28 +02:00

Simple TTS

A simple text-to-speech program powered by kokoro.

Setup

Clone repo and go into the directory

$ git clone https://git.ayo.run/ayo/simple-tts
$ cd simple-tts

Create new environment. Here I use conda.

$ conda create -n tts

### for Intel XPU specific device usage:
$ conda create -n tts --clone llm-pt26

Important

For using Intel XPUs, you need to set up ipex-llm environment with pytorch 2.6. Also, see Intel XPU environmental variables" section below.

Activate the environment and install the dependencies

$ conda activate tts
$ python -m pip install -r requirements.txt

Because vlc is used to automatically play the generated audio, you will have to install it:

$ sudo apt update
$ sudo apt install vlc

Note

Installing vlc via flatpak or snap will not work, as the code need access to libvlc.

Intel XPU environmental variables

For XPUs, we need to set some environmental variables. I have added a env.sh script which will activate the conda environment tts and set the environmental variables.

$ . env.sh

Usage

Go into the directory and activate the environment:

$ cd simple-tts
$ conda activate tts

If using Intel XPUs, set the env variables

$ . env.sh

To run the program it needs an input file using the flag --input.

$ python tts.py --input demo/tongue-twister.txt --voice asmr

Voices

Optionally, you can indicate a voice you want to use with the --voice flag. See all voices available.

$ python tts.py --voice am_michael

There are four shortcuts available to the best voices: pro, hot, asmr, brit (i.e., best trained voices), and pro is the default if no value is given

$ python tts.py --voice pro # af_heart

$ python tts.py --voice hot # af_bella

$ python tts.py --voice asmr # af_nicole

$ python tts.py --voice brit # bf_emma