A simple command-line interface for Kokoro TTS.
git clone [email protected]:jarmitage/kokoro-tts-cli.git
cd kokoro-tts-cli
pip install -e .
Basic usage:
tts --text "Hello, world!" --language en-gb
Argument | Default | Description |
---|---|---|
--text |
None | Direct input text to convert to speech |
--input_file |
None | Path to input file (.txt or .md) |
--output_dir |
"." | Directory path for output files |
--filename |
"output" | Base filename for output (without extension) |
--language |
"en-gb" | Language code (see supported languages below) |
--voice |
"bf_isabella" | Voice ID to use (e.g. bf_alice) |
--speed |
1.0 | Speech speed multiplier |
--split_pattern |
"\n+" | Regex pattern for splitting text into chunks |
--sample_rate |
24000 | Output audio sample rate in Hz |
--mode |
"both" | Output mode ('play', 'save', or 'both') |
--wait_after_play |
True | Wait for audio to finish before processing next chunk |
--stitch |
False | Combine all audio chunks into a single file (only in save modes) |
en-us
: American Englishen-gb
: British Englishes
: Spanishfr
: Frenchhi
: Hindiit
: Italianja
: Japanesept-br
: Brazilian Portuguesezh
: Mandarin Chinese
- Convert text to speech and play it:
tts --text "Hello, world!" --language en-gb
- Convert a markdown file to speech and save it:
tts --input_file document.md --mode save --output_dir output/
- Convert text with custom speed and voice:
tts --text "Hello, world!" --speed 1.2 --voice bf_alice
- Install it locally in development mode:
cd tts
pip install -e .
After installation, you can use the command tts
from anywhere in your terminal. For example:
tts --text "Hello, world!" --language en-gb