Skip to content

About

TTS-Story is a web-based multi‑voice TTS studio for turning tagged scripts into audiobooks—featuring full speaker management, chunk review/regeneration, a job queue and library system, and local GPU or API backends including Kokoro, Chatterbox, VOX CPM, Pocket-TTS, Kitten-TTS, IndexTTS-2, QWEN3 TTS and Omnivoice engines

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

163 Commits

Folders and files

Repository files navigation

☕ Support Ongoing Development

If you enjoy TTS-Story and my other open-source projects, consider supporting continued development! Every contribution helps keep things moving and motivates new features, bug fixes, and improvements across all my projects.

👉 Buy me a pizza (or whatever you'd like to contribute)

Thank you — it genuinely means a lot! 🙏


Current Updates and Notes - updated 04-15-2026

  • UI consolidation: Simplified rebuild/repair workflow — consolidated multiple rebuild options (rebuild full story, recompile audio, repair) into a single "Rebuild" button in the library view. The new Rebuild button recompiles all chapter audio files from individual audio chunks and then recompiles the full audiobook from the chapter files, with a confirmation dialog before execution.
  • Performance improvement: Parallel chapter merging — applied ThreadPoolExecutor with dynamic worker allocation (based on os.cpu_count()) to all chapter merging operations including main generation, repair/rebuild, rebuild selected chapters, and rebuild all operations. This significantly reduces post-processing time for multi-chapter audiobooks by merging chapters concurrently.
  • Bug fix: Download filename now uses project name — download filenames now use the audiobook title from metadata (e.g., {audiobook_title}_{job_id}.{format}) instead of the hardcoded "kokoro_story" prefix, making downloads easier to identify.
  • Bug fix: Long folder/file name handling and M4B export efficiency — fixed WinError 206 (path too long) by reducing slugify_filename max_length from 120 to 60, replacing the fragile concat:pipe|joined protocol with -f concat -safe 0 -i list_file for ffmpeg, adding Windows extended-length path (\\?\) prefix helper for subprocess calls, and encoding M4B temp intermediates to .m4a (AAC in MP4 container) instead of raw ADTS .aac for accurate duration metadata and proper bitrate control. Chapter markers now work correctly across all chapters with proper file sizes.
  • Bug fix: OmniVoice installation issue — fixed missing omnivoice_worker.py file on clean installs by removing engines/omnivoice/ from .gitignore and only excluding the .venv subdirectory. The worker file is now properly tracked in version control.
  • Added dynamic section heading detection with chip-based UI — enable/disable default section headings (book, chapter, section, letter, part, prologue, epilogue) and add custom headings via removable chips. Section detection now dynamically updates in real-time as you toggle headings or add custom ones.
  • Added parallel AAC encoding for M4B export — chapters are encoded to AAC format in parallel using a thread pool before concatenation, significantly reducing M4B export time for multi-chapter audiobooks.
  • Added M4B audiobook export for chapter-mode jobs — download audiobooks as M4B format with embedded chapter markers, cover art support, and configurable bitrate (64-192 kbps) and ACX compliance options for audiobook distribution platforms.

Previous Updates

  • Added audiobook metadata editing — edit title, author, genre, year, and description for library items, with persistent storage that survives application reloads.
  • Added chapter rename functionality — rename individual chapters via the chapter chip dropdown menu or directly from the chunk review modal header.
  • UI improvements: Library item action buttons now wrap to multiple lines on narrow screens instead of overflowing; modal overlays use high z-index and proper backdrop styling for visibility.
  • Bug fix: M4B cover art now properly converts images to JPEG format with RGB mode and appropriate sizing for maximum compatibility across media players.
  • Added OmniVoice engine modes (Voice Clone & Voice Design) with paralinguistic tags and multi-speaker support.
  • Added Auto Assign button for fuzzy-matching voice samples to detected speakers with adjustable similarity threshold.
  • Added Clear Queue button and Time Codes modal for YouTube chapter timestamp generation.

TTS-Story

A web-based Text-to-Speech application supporting multiple TTS engines including Kokoro-82M, Chatterbox, VoxCPM 1.5, Qwen3 TTS (Custom Voice, Clone, Voice Creation), Pocket TTS (CPU-friendly), KittenTTS (ultra-lightweight CPU-only), and IndexTTS (zero-shot voice cloning by Bilibili), with both local GPU inference and Replicate cloud API options for generating multi-voice audiobooks and stories.

Features

TTS Engines

  • Multi-Engine Support: Choose from twelve TTS engine options:
    • Kokoro · Local GPU - Run Kokoro-82M locally on your NVIDIA GPU
    • Kokoro · Replicate - Use Kokoro via Replicate cloud API
    • Chatterbox · Local GPU - Run Chatterbox locally with voice cloning (~8GB VRAM required)
    • Chatterbox · Replicate - Use Chatterbox via Replicate cloud API (resemble-ai/chatterbox-turbo)
    • VoxCPM 1.5 · Local GPU - Run VoxCPM 1.5 locally with voice cloning and automatic transcription
    • Pocket TTS · Preset Voices - CPU-only preset voices with fast local generation
    • Pocket TTS · Voice Clone - CPU-only voice cloning using reference prompts
    • Qwen3 TTS · Custom Voice - Generate with Qwen3 TTS custom voice prompts
    • Qwen3 TTS · Clone - Clone a voice from reference audio using Qwen3 TTS
    • Qwen3 TTS · Voice Creation - Create a brand-new voice using Qwen3 TTS voice design
    • KittenTTS - Ultra-lightweight CPU-only engine, no GPU required
    • IndexTTS - Zero-shot voice cloning by Bilibili, runs in an isolated venv
  • Unified Replicate API: Single API token works for both Kokoro and Chatterbox Replicate engines
  • Voice Cloning: Upload your own voice recordings (10-15 seconds recommended) to clone any voice with Chatterbox or VoxCPM
  • Voice Prompt Management: Add, rename, delete, and preview custom voice prompts with drag-and-drop bulk upload
  • External Voice Library: Browse and download 500+ voice samples from the TTS Samples repository directly in the app
  • Qwen3 TTS Modes: Dedicated flows for Custom Voice, Clone, and Voice Creation to generate, clone, or design new voices

Voice & Audio

  • Multi-Voice Support: Use Kokoro-82M voices for any number of characters in your story
  • Custom Voice Blending: Mix any combination of Kokoro voices with weighted ratios to create reusable "custom_*" voice codes
  • Speaker Tags & Auto Detection: Automatically parse [speaker1]...[/speaker1] or [alice]...[/alice] tags
  • Smart Text Chunking: Automatically splits long texts into manageable chunks with per-engine configurable character limits
  • Alternate Word Registry: Define word substitutions for terms TTS engines mispronounce — replacements are applied automatically before synthesis
  • Seamless Audio Merging: Merges chunks into a single file with configurable crossfade
  • Intro & Inter-Segment Silence Controls: Dial in precise empty space before the first line and between chunks

AI & Processing

  • Gemini Pre-Processing: Automatically decides between whole-text or chapter-based Gemini runs with speaker-memory context
  • Speaker Memory Between Chunks: Gemini requests carry forward discovered speaker tags for consistency
  • Local GPU Processing: Run entirely on your machine for privacy and speed
  • Cloud API Option: Use Replicate API when you don't have local GPU resources

Job Management & Library

  • Job Queue: Submit multiple jobs, track real-time progress with ETA, cancel, and download results
  • Job Queue Tab: Dedicated UI to monitor all jobs with progress bars and chunk counts
  • Audio Library: Browsable list of all completed outputs with inline players, engine indicator showing which TTS engine was used, and delete/clear controls
  • Chapter Collections + Full Audiobook: Toggle per-chapter outputs and optionally create a single combined audiobook

UI & Configuration

  • Available Voices & Previews: Browse all Kokoro voices grouped by language, generate preview samples
  • Configurable Settings: Control TTS engine, speed, chunk size, output format, bitrate, crossfade
  • Dynamic Gemini Controls: Save your Gemini API key, fetch the latest available Gemini models on demand
  • Web Interface: Modern single-page UI built with Flask and vanilla JS

Available Voices

Kokoro Voices

TTS-Story exposes the full Kokoro-82M voice set, grouped by language.

American English 🇺🇸 (lang_code a)

  • Female: af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky
  • Male: am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa

British English 🇬🇧 (lang_code b)

  • Female: bf_alice, bf_emma, bf_isabella, bf_lily
  • Male: bm_daniel, bm_fable, bm_george, bm_lewis

Spanish 🇪🇸 (lang_code e)

  • ef_dora, em_alex, em_santa

French 🇫🇷 (lang_code f)

  • ff_siwis

Hindi 🇮🇳 (lang_code h)

  • hf_alpha, hf_beta, hm_omega

Japanese 🇯🇵 (lang_code j)

  • jf_alpha, jf_gongitsune, jf_nezumi, jf_tebukuro, jm_kumo

Mandarin Chinese 🇨🇳 (lang_code z)

  • zf_xiaobei, zf_xiaoni, zf_xiaoxiao, zf_xiaoyi

Brazilian Portuguese 🇧🇷 (lang_code p)

  • pf_dora, pm_alex, pm_santa

All of these voices are browsable in the Available Voices tab, where you can generate and play preview samples.

Voice Prompts (Chatterbox & VoxCPM)

Both Chatterbox and VoxCPM support voice cloning from audio recordings. Voice prompts are shared between these engines.

Adding Voice Prompts

  1. Go to the Available Voices tab → Voice Prompts section
  2. Upload a voice recording (WAV, MP3, M4A, FLAC, or OGG format)
    • Recommended duration: 10-15 seconds of clear speech
    • Avoid background noise for best results
  3. Give the voice a descriptive name and click Save Voice
  4. Your custom voices appear in all Chatterbox/VoxCPM voice dropdowns

You can also drag-and-drop multiple audio files for bulk upload.

Voice Prompt Management

The Voice Prompts section provides a sortable list view with:

  • Name, Gender, Language, Duration, Source columns
  • Sortable headers - Click any column to sort
  • Filtering - Filter by gender, language, or source (local vs external)
  • Search - Find voices by name
  • Edit - Click Edit to modify name, gender, and language metadata
  • Preview - Play any voice sample directly
  • Delete - Remove unwanted voice prompts

External Voice Library

TTS-Story integrates with the TTS Samples repository, providing access to 500+ pre-recorded voice samples in multiple languages:

  1. In the Voice Prompts section, external voices appear with an "External" source badge
  2. Click Download to save any external voice locally
  3. Downloaded voices become local and can be edited/deleted
  4. Filter by source to show only local or external voices

Voice Dropdown Enhancements

All voice selection dropdowns (main screen and library) now show:

  • Gender indicator: [M] for Male, [F] for Female
  • Language: Human-readable language name (e.g., "English (UK)")
  • Duration: Sample length in seconds
  • Filter controls: Filter by gender and language before selecting

Installation

Prerequisites

  • Python 3.9 or higher
  • NVIDIA GPU with CUDA support (optional, for local GPU inference)
  • Internet connection (for downloading dependencies)

Automatic Installation (Recommended)

  1. Run the installer/updater

To download the installer, Right-Click the link and click "Save As": Install-Update.bat

The installer will clone or update the repository, then run the setup script which will automatically:

  • ✅ Detect your Python version
  • ✅ Create a Python virtual environment
  • ✅ Detect your NVIDIA GPU and CUDA version
  • ✅ Install PyTorch with appropriate CUDA support (or CPU-only if no GPU)
  • ✅ Download and install espeak-ng automatically
  • ✅ Install all other required dependencies
  • ✅ Download the Rubber Band CLI and wire it up for high-quality pitch/tempo FX
  • ✅ Verify the installation

Supported CUDA Versions:

  • CUDA 12.9, 12.8, 12.6, 12.4, 12.1
  • CUDA 11.8
  • CPU-only (automatic fallback if no GPU detected)
  1. Start the application
run.bat
  1. Open your browser
http://localhost:5000

Manual Installation

If you prefer to install manually or the automatic setup fails:

  1. Install espeak-ng

  2. Install Rubber Band CLI (for pitch/tempo FX quality)

  3. Create virtual environment

python -m venv venv
venv\Scripts\activate
  1. Install PyTorch with CUDA support
# For CUDA 12.1 (most common)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

# For CPU only
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
  1. Install other dependencies
pip install -r requirements.txt
  1. Run the application
python app.py

Usage

Selecting a TTS Engine

TTS-Story supports twelve TTS engine options. In the Settings tab, choose your preferred default engine:

Engine Description Requirements
Kokoro · Local GPU Run Kokoro-82M locally NVIDIA GPU with CUDA
Kokoro · Replicate Kokoro via cloud API Replicate API token
Chatterbox · Local GPU Chatterbox with voice cloning NVIDIA GPU (~8GB VRAM)
Chatterbox · Replicate Chatterbox via cloud API Replicate API token
VoxCPM 1.5 · Local GPU VoxCPM with voice cloning & auto-transcription NVIDIA GPU (~6GB VRAM)
Qwen3 TTS · Custom Voice Qwen3 TTS custom voice prompts NVIDIA GPU (local)
Qwen3 TTS · Clone Qwen3 TTS voice cloning from reference audio NVIDIA GPU (local)
Qwen3 TTS · Voice Creation Qwen3 TTS voice design (new voice creation) NVIDIA GPU (local)
Pocket TTS · Preset Voices CPU-only preset voices, no GPU needed CPU only
Pocket TTS · Voice Clone CPU-only voice cloning from reference prompts CPU only
KittenTTS Ultra-lightweight CPU-only, 8 built-in voices CPU only
IndexTTS Zero-shot voice cloning, English + Chinese NVIDIA GPU recommended; isolated venv

You can also override the engine per-job in the Generate tab.

VoxCPM 1.5 Engine

VoxCPM 1.5 is a powerful voice cloning engine with unique features:

  • Automatic Transcription: If no transcript is provided, VoxCPM uses SenseVoice ASR to automatically transcribe the reference audio
  • Shared Voice Prompts: Uses the same voice prompt library as Chatterbox
  • Lower VRAM Requirements: Runs on GPUs with ~6GB VRAM
  • High Quality Output: Produces natural-sounding speech with good prosody

IndexTTS Engine

IndexTTS (by Bilibili) is a state-of-the-art zero-shot voice cloning engine with emotion control:

  • Zero-Shot Voice Cloning: Clone any voice from a short reference audio (up to 15 seconds)
  • Reuses Voice Prompts Library: Uses the same voice prompt files as Chatterbox/VoxCPM — no new voice management needed
  • Emotion Control (IndexTTS-2): Condition speech on a separate emotion reference audio, an 8-value emotion vector, or a text description
  • English + Chinese: Supports both languages natively
  • GPU Recommended: Runs on CUDA, MPS (Apple Silicon), or CPU (slow)
  • FP16 Support: Halves VRAM usage with minimal quality loss
  • Isolated Environment: Runs in its own uv venv under engines/index-tts/ to avoid dependency conflicts
  • Multiple Model Versions: IndexTTS-2 (recommended), IndexTTS-1.5, IndexTTS-1.0

IndexTTS Setup

  1. Run setup.bat — it will automatically clone the repo and run uv sync if git and uv are available
  2. Download model weights (one-time, several GB):
    cd engines/index-tts
    uv tool run huggingface-cli download IndexTeam/IndexTTS-2 --local-dir=checkpoints
  3. Select IndexTTS from the engine dropdown in Settings or the Generate tab
  4. Assign voice prompts per speaker — uses the existing Voice Prompts library

IndexTTS Settings

Setting Default Description
Model Version IndexTTS-2 Which model version to use
Chunk Size 400 chars Character limit per synthesis chunk
Device auto cuda, cuda:0, cpu, or auto
Default Voice Prompt (empty) Fallback reference audio path
Use FP16 true Half-precision inference (faster, less VRAM)
Use DeepSpeed false Optional inference speedup

KittenTTS Engine

KittenTTS is an ultra-lightweight, CPU-only TTS engine — ideal for machines without a GPU:

  • No GPU Required: Runs entirely on CPU, no CUDA needed
  • Tiny Footprint: Model weights under 25MB, fast to download and load
  • 8 Built-in Voices: Bella, Jasper, Luna, Bruno, Rosie, Hugo, Kiki, Leo
  • Multiple Model Sizes: Choose from kitten-tts-mini-0.8 (recommended), kitten-tts-micro-0.8, or kitten-tts-nano-0.8 (fp32/int8) for speed vs. quality trade-offs
  • English Only: Optimised for English narration
  • Installation: Install separately via pip install https://github.com/KittenML/KittenTTS/releases/download/0.8/kittentts-0.8.0-py3-none-any.whl

KittenTTS Settings

Setting Default Description
Model ID KittenML/kitten-tts-mini-0.8 Which KittenTTS model to load
Default Voice Jasper Fallback voice when no per-speaker assignment is set
Chunk Size 300 chars Character limit per synthesis chunk (lower = faster on CPU)

Basic Workflow

  1. Open your browser to http://localhost:5000
  2. In Settings, select your preferred TTS engine
  3. If using Replicate engines, enter your API token in the Replicate API section
  4. Paste your text with or without speaker tags in the Generate tab
  5. Select a Default Voice (used for plain text / unassigned speakers)
  6. If you use speaker tags, TTS-Story automatically analyzes the text and lets you assign voices per speaker
  7. Click Generate Audio
  8. The job is added to the Job Queue, processed in the background, and the result appears in:
    • Job Queue tab (with real-time progress, ETA, and player)
    • Library tab (all past generations with engine indicator)

Using Voice Cloning (Chatterbox & VoxCPM)

When using Chatterbox or VoxCPM engines:

  1. First, add voice recordings in Available Voices → Voice Prompts
  2. In the Generate tab, select your cloned voice from the Reference Prompt dropdown
  3. Use the gender and language filters to quickly find the right voice
  4. Each speaker can use a different cloned voice for multi-character stories

Quick Test Previews

  • A shared "Quick Test Text" field lives above the Assigned Voices section so you can type once and preview any speaker with matching FX.
  • Each speaker row includes an inline Quick Test button beside the tone controls.

Note: Local GPU modes run entirely on your machine and never use cloud APIs, ensuring complete privacy and no API costs.

Silence & Timing Controls

  • Intro Silence (ms): Adds empty space before the very first spoken line
  • Silence Between Segments (ms): Inserts a gap after each chunk/line before the next one begins
  • Both settings are configurable in the Generation Settings panel (0–2000 ms, 100 ms steps)

Replicate API Setup

Both Kokoro · Replicate and Chatterbox · Replicate use the same API token:

  1. Get your API key from Replicate (starts with r8_...)
  2. In Settings, enter your token in the Replicate API section
  3. Click Save Settings
  4. Select either Replicate engine from the dropdown

Speaker Tag Format

You can use either numbered speakers or named speakers:

Numbered Format:

[speaker1]Hello, my name is Alice.[/speaker1]
[speaker2]Nice to meet you, Alice! I'm Bob.[/speaker2]
[speaker1]It's great to meet you too![/speaker1]

Named Format:

[narrator]Once upon a time, in a land far away...[/narrator]
[alice]Hello, my name is Alice.[/alice]
[bob]Nice to meet you, Alice! I'm Bob.[/bob]
[narrator]And so their adventure began.[/narrator]

You can use any alphanumeric name (letters, numbers, underscores). The system will automatically detect all unique speakers and let you assign voices to each one.

Gemini Pre-Processing Workflow

Need to tidy a manuscript or add consistent speaker tags before running TTS? Use the Prep Text with Gemini button:

  1. Enter your Gemini API key and model in Settings, then click Fetch Available Models if you want to load the latest list directly from Google.
  2. Paste your story in the Generate tab and decide whether "Generate separate audio files for each chapter" should be enabled.
  3. Select a Prompt Preset (see below) or write your own custom prompt.
  4. Click Prep Text with Gemini:
    • If chapter splitting is enabled, TTS-Story reuses the detected chapter list and sends each one to Gemini separately with your pre-prompt and the running speaker list.
    • If chapter splitting is disabled, the whole manuscript (plus pre-prompt) is sent in a single Gemini request to respect the context window.
    • A real-time progress bar shows which chapter or full-text step is running.
  5. When Gemini finishes, the cleaned/expanded narrative replaces the input field. Chapter headings stay inside the narrator tags so audio splitting still works.
  6. Re-run Analyze Text if needed. Your voice assignments and FX settings remain untouched unless you explicitly reset them.

Because the speaker list is tracked across sections, characters that appear later continue to use the same tag, which keeps the voice assignment UI tidy and prevents duplicate dropdowns.

Pre-loaded Prompt Presets

TTS-Story includes pre-configured Gemini prompt presets optimized for different use cases:

Preset Best For Description
Chatterbox Natural Dialogue Conversation Chatterbox engines Transforms text into natural-sounding dialogue with paralinguistic tags (laughter, sighs, pauses) and human speech quirks. Ideal for conversational content where you want expressive, lifelike output.
Chatterbox Audio Book Conversion Chatterbox engines Maintains strict adherence to the original text while converting symbols and abbreviations that TTS engines struggle with into speakable words (e.g., "/" → "slash", "-" → "dash", "Dr." → "Doctor").
Strict Book Narration V1 Kokoro & other engines Preserves the exact text of the book while adding speaker tags and preparing the content for TTS conversion. Improved instruction adherence ensures the original prose is never paraphrased or summarised.

Select a preset from the dropdown in the Gemini section, or create your own custom prompts and save them for reuse.

Plain Text Mode

If no speaker tags are found, the entire text will be processed with a single voice.

Job Queue & Library

  • Job Queue tab shows all jobs with:
    • Real-time progress bars and chunk counts
    • ETA estimates during processing
    • Status indicators (queued, processing, completed, failed, cancelled)
    • Per-job controls (cancel, download)
  • Library tab lists all completed outputs (sorted newest first) with:
    • Engine indicator showing which TTS engine was used (Kokoro, Kokoro Replicate, Chatterbox, Chatterbox Replicate)
    • Inline audio players
    • Download links
    • Delete and "Clear All" controls

Available Voices & Previews

  • Available Voices tab lists all Kokoro-82M voices grouped by language.
  • You can:
    • Generate preview samples for all voices
    • Regenerate (overwrite) samples if you change text or update voices
    • Click any voice to play its preview sample

Custom Voice Blends

  • Open the Custom Voice Blends panel inside the Available Voices tab to create bespoke voices.
  • Click New Custom Voice (or Edit on any card) to open the modal where you can:
    • Name the blend and choose its language group (lang_code)
    • Add one or more component voices and set their mix weights (e.g., 0.5 narrator + 0.5 af_heart)
    • Optionally add notes for future reference
  • Saved blends appear in the grid with metadata (code, language, updated time) and can be edited or deleted at any time.
  • All custom voices automatically show up in:
    • Default voice dropdowns
    • Per-speaker assignment selects (grouped by language under “Custom Blends” optgroups)
    • /api/voices responses (custom_voices arrays per language) so automation scripts can use them.
  • When the generator encounters a custom_* voice, the backend blends the component embeddings on the fly and caches the tensor for fast reuse.

Tip: The API exposes the full CRUD workflow under /api/custom-voices, so you can script voice creation or keep predefined blends in source control.

Configuration

Settings are stored in config.json:

{
  "replicate_api_key": "",
  "chunk_size": 500,
  "sample_rate": 24000,
  "speed": 1.0,
  "output_format": "mp3",
  "output_bitrate_kbps": 128,
  "crossfade_duration": 0.1,
  "intro_silence_ms": 0,
  "inter_chunk_silence_ms": 0,
  "tts_engine": "kokoro",
  "chatterbox_turbo_local_device": "auto",
  "chatterbox_turbo_local_temperature": 0.8,
  "chatterbox_turbo_replicate_model": "resemble-ai/chatterbox-turbo",
  "voxcpm_local_device": "auto",
  "gemini_api_key": "",
  "gemini_model": "gemini-2.0-flash"
}

TTS Engine Options

Value Description
kokoro Kokoro-82M local GPU inference
kokoro_replicate Kokoro via Replicate cloud API
chatterbox_turbo_local Chatterbox local GPU with voice cloning
chatterbox_turbo_replicate Chatterbox via Replicate cloud API
voxcpm_local VoxCPM 1.5 local GPU with voice cloning
qwen3_custom_voice Qwen3 TTS custom voice mode
qwen3_clone Qwen3 TTS voice cloning mode
qwen3_voice_creation Qwen3 TTS voice creation mode
pocket_tts Pocket TTS preset voices (CPU-only)
pocket_tts_preset Pocket TTS voice clone mode (CPU-only)
kitten_tts KittenTTS CPU-only engine
index_tts IndexTTS zero-shot voice cloning

Any settings you override in the Generate tab (format, bitrate, engine) are sent along with the job payload while keeping the saved defaults intact.

Project Structure

TTS-Story/
├── app.py                 # Flask web server
├── requirements.txt       # Python dependencies
├── setup.bat             # Windows setup script
├── run.bat               # Windows run script
├── config.json           # Configuration file
├── src/
│   ├── tts_engine.py     # TTS engine registry and factory
│   ├── replicate_api.py  # Replicate API integration (Kokoro)
│   ├── text_processor.py # Text chunking and parsing
│   ├── audio_merger.py   # Audio file merging
│   ├── voice_manager.py  # Voice configuration and preview sample metadata
│   ├── voice_sample_generator.py # Batch generation of voice preview samples
│   └── engines/
│       ├── kokoro_engine.py              # Kokoro-82M local engine
│       ├── chatterbox_turbo_local_engine.py    # Chatterbox local GPU engine
│       ├── chatterbox_turbo_replicate_engine.py # Chatterbox Replicate engine
│       ├── voxcpm_local_engine.py        # VoxCPM 1.5 local GPU engine
│       ├── pocket_tts_engine.py          # Pocket TTS CPU-only engine
│       ├── qwen3_engine.py               # Qwen3 TTS engine (custom/clone/design)
│       ├── kitten_tts_engine.py          # KittenTTS CPU-only engine
│       └── index_tts_engine.py           # IndexTTS subprocess adapter
├── engines/
│   └── index-tts/                    # Cloned IndexTTS repo (isolated venv)
│       ├── .venv/                        # uv-managed isolated environment
│       ├── checkpoints/                  # Downloaded model weights
│       └── tts_worker.py                 # Worker script called by the adapter
├── static/
│   ├── css/
│   │   └── style.css
│   ├── js/
│   │   ├── main.js
│   │   ├── queue.js
│   │   ├── library.js
│   │   ├── voice-manager.js
│   │   └── settings.js
│   ├── audio/            # Generated audio files (per-job subdirectories)
│   └── samples/          # Voice preview samples and manifest.json
├── data/
│   └── voice_prompts/    # Chatterbox voice recordings for cloning
└── templates/
    └── index.html        # Web interface

API Endpoints

  • GET / - Main web interface
  • GET /api/health - Health check (TTS engine, Kokoro availability, CUDA status)
  • GET /api/voices - Get available voices and preview sample status
  • POST /api/voices/samples - Generate or regenerate voice preview samples
  • GET /api/settings - Get current settings
  • POST /api/settings - Update settings
  • POST /api/analyze - Analyze text and return statistics/speakers
  • POST /api/gemini/sections - Preview the sections (chapters/chunks) Gemini will process for a given input
  • POST /api/gemini/process-section - Send a single section to Gemini (called in sequence by the frontend for live progress updates)
  • POST /api/gemini/process - Process the entire text through Gemini in one backend call (used for scripted workflows)
  • POST /api/gemini/models - Fetch available Gemini models after providing an API key
  • POST /api/generate - Queue a new audio generation job
  • GET /api/status/<job_id> - Check status of a specific job
  • POST /api/cancel/<job_id> - Cancel a queued or running job
  • GET /api/queue - Get all jobs, their status, and current queue size
  • GET /api/download/<job_id> - Download generated audio file
  • GET /api/library - List all completed audio files
  • DELETE /api/library/<job_id> - Delete a specific library item
  • POST /api/library/clear - Delete all library items
  • GET /api/custom-voices - List custom voice blends (includes normalized metadata and component weights)
  • POST /api/custom-voices - Create a new custom voice blend
  • GET /api/custom-voices/<voice_id> - Retrieve a specific custom voice (ID or custom_ code)
  • PUT /api/custom-voices/<voice_id> - Update an existing custom voice blend
  • DELETE /api/custom-voices/<voice_id> - Delete a custom voice and invalidate cached tensors
  • GET /api/chatterbox-voices - List saved voice prompts (for Chatterbox/VoxCPM)
  • POST /api/chatterbox-voices - Upload a new voice prompt
  • PUT /api/chatterbox-voices/<voice_id>/update - Update voice metadata (name, gender, language)
  • DELETE /api/chatterbox-voices/<voice_id> - Delete a voice prompt
  • GET /api/chatterbox-voices/<voice_id>/preview - Preview a voice prompt
  • GET /api/voice-prompts - List voice prompts with metadata (gender, language, duration)
  • GET /api/external-voices - List available external voice samples from GitHub
  • POST /api/external-voices/<voice_id>/download - Download an external voice sample locally

Performance

Kokoro · Local GPU (NVIDIA RTX 3090)

  • ~2 seconds per chunk (500 words)
  • No API costs
  • Full privacy

Kokoro · Replicate

  • ~2-3 seconds per chunk (varies by input)
  • Cost varies by usage
  • No GPU required
  • Model: jaaari/kokoro-82m

Chatterbox · Local GPU

  • Requires ~8GB VRAM
  • Voice cloning from 10-15 second audio samples
  • No API costs
  • Full privacy

Chatterbox · Replicate

VoxCPM 1.5 · Local GPU

  • Requires ~6GB VRAM
  • Voice cloning from audio samples
  • Automatic transcription via SenseVoice ASR
  • No API costs
  • Full privacy

Pocket TTS · CPU

  • No GPU required — runs on any CPU
  • Preset voices and voice cloning from reference prompts
  • No API costs
  • Full privacy

KittenTTS · CPU

  • No GPU required — ultra-lightweight (<25MB model)
  • 8 built-in English voices
  • Default chunk size: 300 chars (tunable in Settings → Engine Settings)
  • No API costs
  • Full privacy
  • Install: pip install https://github.com/KittenML/KittenTTS/releases/download/0.8/kittentts-0.8.0-py3-none-any.whl

IndexTTS · Local GPU (NVIDIA recommended)

  • Zero-shot voice cloning from reference audio
  • GPU strongly recommended; CPU mode works but is slow
  • FP16 inference halves VRAM usage
  • Default chunk size: 400 chars
  • Runs in isolated uv venv — no dependency conflicts with main project
  • No API costs
  • Full privacy
  • Model download: uv tool run huggingface-cli download IndexTeam/IndexTTS-2 --local-dir=checkpoints

Troubleshooting

espeak-ng not found

Make sure espeak-ng is installed and in your PATH.

CUDA out of memory

Reduce chunk_size in settings or use a Replicate engine instead of local GPU.

Audio quality issues

Adjust the speed parameter (0.5 - 2.0) in settings.

License

Apache 2.0 - Same as Kokoro-82M

Credits

Support

For issues and questions, please open an issue on GitHub.

About

TTS-Story is a web-based multi‑voice TTS studio for turning tagged scripts into audiobooks—featuring full speaker management, chunk review/regeneration, a job queue and library system, and local GPU or API backends including Kokoro, Chatterbox, VOX CPM, Pocket-TTS, Kitten-TTS, IndexTTS-2, QWEN3 TTS and Omnivoice engines

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages