Skip to content

jarmitage/kokoro-tts-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kokoro TTS CLI tool

A simple command-line interface for Kokoro TTS.

Installation

git clone [email protected]:jarmitage/kokoro-tts-cli.git
cd kokoro-tts-cli
pip install -e .

Usage

Basic usage:

tts --text "Hello, world!" --language en-gb

Command Line Arguments

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)

Supported Languages

  • en-us: American English
  • en-gb: British English
  • es: Spanish
  • fr: French
  • hi: Hindi
  • it: Italian
  • ja: Japanese
  • pt-br: Brazilian Portuguese
  • zh: Mandarin Chinese

Examples

  1. Convert text to speech and play it:
tts --text "Hello, world!" --language en-gb
  1. Convert a markdown file to speech and save it:
tts --input_file document.md --mode save --output_dir output/
  1. Convert text with custom speed and voice:
tts --text "Hello, world!" --speed 1.2 --voice bf_alice
  1. 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

About

Simple CLI app for TTS using Kokoro

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages