Convert any text file into a narrated audiobook. Splits long text into chapters, generates audio for each, and combines them into a single file.
- Read text from a file or stdin
- Automatically split into chapters by paragraph breaks or custom markers
- Generate audio with a consistent narrator voice
- Combine all chapters into a single WAV file
- Individual chapter files saved for easy navigation
Base dependencies are installed via the root
requirements.txt. See the main README for setup. AddSMALLEST_API_KEYto your.env.
From a text file:
uv run generate.py story.txtWith custom options:
uv run generate.py story.txt --voice magnus --speed 0.9 --chapter-marker "---"From inline text (for quick testing):
uv run generate.py --text "Once upon a time, in a land far away, there lived a curious inventor."| Parameter | Description | Default |
|---|---|---|
--voice |
Narrator voice | sophia |
--speed |
Narration speed (0.5–2.0) | 1.0 |
--model |
TTS model | lightning-v3.1 |
--chapter-marker |
Text that separates chapters | --- |
--max-chunk |
Max characters per API call | 500 |
--text |
Inline text instead of file | — |
audiobook_output/
├── audiobook.wav # Full audiobook
├── chapter_01.wav # Individual chapters
├── chapter_02.wav
└── ...
- For best results, use clear paragraph breaks in your text
- The
--chapter-markerflag lets you control exactly where chapters split - Long paragraphs are automatically chunked (max 500 chars) for reliable synthesis
- Use
--speed 0.9for a more relaxed narration pace
- Podcast Generator — Multi-voice conversation from a topic
- Voices — Pick the perfect narrator voice