A high-quality text-to-speech CLI using the Kokoro API. This is HEAVILY inspired by nazdridoy/kokoro-tts but my vision for it differed too greatly for me to fork it.
uv sync
Convert text to audio:
uv run tts-studio convert input.txt
Convert EPUB file:
uv run tts-studio convert book.epub
Convert PDF file:
uv run tts-studio convert document.pdf
Stream from stdin:
echo "Hello world" | tts-studio convert -
uv run tts-studio convert INPUT_FILE [OUTPUT_FILE] [OPTIONS]
Arguments:
INPUT_FILE: Path to input file (text, EPUB, PDF) or - for stdinOUTPUT_FILE: (Optional) Output audio file pathOptions:
--voice: Voice ID to use (default: af_heart)--speed: Speech speed multiplier (default: 1.0)--lang: Language code (a = en/en-us, b = en-gb, default: a)--stream: Enable real-time audio streaming--split-output: Directory to save individual chapter files instead of one fileConvert with custom voice and speed:
uv run tts-studio convert input.txt --voice af_heart --speed 1.2
Split EPUB chapters into separate files:
uv run tts-studio convert book.epub --split-output ./audio_chapters/
Convert PDF with British English:
uv run tts-studio convert document.pdf --lang en-gb
Stream audio in real-time:
uv run tts-studio convert input.txt --stream
- as the input file