BKris2315/book2speech

0

stars

2

commits

Python

primary language

May 17, 2026

updated

README

book2speech

A Python app that converts books into chapter-wise audiobook files with expressive TTS.

Features

  • Input formats:
    • .txt
    • .docx
    • .epub
    • .pdf
    • .azw, .azw3, .mobi (via Calibre conversion)
  • Chapter-level output: WAV or MP3 per chapter
  • Engines: Parler, Kokoro, XTTS v2
  • Web UI with progress logs and chapter preview player
  • Output manifest.json for generated chapters

Engines, models, voices, languages

Parler

  • Engine: parler
  • Model ID: parler-tts/parler-tts-mini-v1
  • Best language: English
  • Voice control: style prompt text (--style), no fixed voice list

Kokoro

  • Engine: kokoro
  • Model: hexgrad/Kokoro-82M (through kokoro package)
  • Best language: English
  • Voice IDs in this app:
    • Female adult: af_heart, af_bella, af_nicole, af_sarah
    • Male adult: am_adam, am_eric, am_michael
    • British female adult: bf_emma, bf_isabella
    • British male adult: bm_george, bm_lewis

XTTS v2 (multilingual)

  • Engine: xtts
  • Model ID: tts_models/multilingual/multi-dataset/xtts_v2
  • Supported in this app: English (en), Spanish (es), German (de), Hungarian (hu)
  • Speaker presets (examples):
    • Female adult: Ana Florence, Claribel Dervla, Daisy Studious, Gracie Wise, Tammie Ema
    • Male adult: Alfie, Albert, Andrew, Brandon, Manuel

Notes:

  • No preset is explicitly tagged as “old”.
  • You can inspect available models/voices from CLI:
book2speech --list-models
book2speech --engine kokoro --list-voices
book2speech --engine xtts --list-voices

Setup

cd /home/asura/repos/tts
  - `.mobi` *(via pure Python library, no installation needed)*
  - `.azw`, `.azw3` *(via Calibre conversion, optional)*

Optional package install:

pip install -e .

Can I run it without installing the package?

Yes.

After dependency install, run directly from source:

python -m book2speech.cli ./my_book.epub --output ./audiobooks
python -m book2speech.web

CLI usage examples

Basic:

book2speech ./my_book.epub --output ./audiobooks

Export only selected chapters:

book2speech ./books/dune.epub --chapters 1,3,5-8 --output ./audiobooks

Export only selected PDF pages (then chapter-split inside that subset):

book2speech ./books/scan.pdf --pages 10-40,55 --output ./audiobooks

Expressive Parler (English):

book2speech ./books/dune.epub \
  --engine parler \
  --style "A warm, immersive narrator, expressive but controlled, clear diction, subtle dramatic emphasis." \
  --max-chars 850 \
  --format mp3 \
  --output ./audiobooks

Kokoro:

book2speech ./my_book.txt \
  --engine kokoro \
  --voice af_heart \
  --speed 1.0 \
  --format wav \
  --output ./audiobooks

Spanish (XTTS):

book2speech ./books/novela.epub \
  --engine xtts \
  --language es \
  --voice "Ana Florence" \
  --format mp3 \
  --output ./audiobooks

German (XTTS):

book2speech ./books/roman.epub \
  --engine xtts \
  --language de \
  --voice "Albert" \
  --format mp3 \
  --output ./audiobooks

Hungarian (XTTS):

book2speech ./books/regeny.epub \
  --engine xtts \
  --language hu \
  --voice "Gracie Wise" \
  --format mp3 \
  --output ./audiobooks

Web UI

Start:

book2speech-web

Open http://localhost:7860, then:

  • upload a book file
  • choose engine (parler, kokoro, or xtts)
  • set voice/style/speed
  • set language (en, es, de, hu) when using XTTS
  • choose output format (wav or mp3)
  • optionally filter chapters (1,3,5-8)
  • optionally filter PDF pages (1-20,25)
  • generate audio, preview chapters, download ZIP

Output

For a book titled My Story:

  • output/my-story/001_Chapter 1.wav (or .mp3)
  • output/my-story/002_Chapter 2.wav (or .mp3)
  • output/my-story/manifest.json

Notes on AZW/AZW3/MOBI

AZW-family formats are converted via Calibre ebook-convert first.

Install Calibre and ensure ebook-convert is available in shell PATH.

DRM-protected books generally cannot be processed.

Practical quality tips

  • For English expressive narration, use parler or kokoro.
  • For Spanish/German/Hungarian, prefer xtts with --language es|de|hu.
  • Tune chunking with --max-chars for cadence.
  • GPU is strongly recommended for speed.
  • MP3 export requires ffmpeg in system PATH.

Contributors

BKris2315

1 commits

BKris2315/book2speech

0

stars

2

commits

Python

primary language

May 17, 2026

updated

README

book2speech

A Python app that converts books into chapter-wise audiobook files with expressive TTS.

Features

  • Input formats:
    • .txt
    • .docx
    • .epub
    • .pdf
    • .azw, .azw3, .mobi (via Calibre conversion)
  • Chapter-level output: WAV or MP3 per chapter
  • Engines: Parler, Kokoro, XTTS v2
  • Web UI with progress logs and chapter preview player
  • Output manifest.json for generated chapters

Engines, models, voices, languages

Parler

  • Engine: parler
  • Model ID: parler-tts/parler-tts-mini-v1
  • Best language: English
  • Voice control: style prompt text (--style), no fixed voice list

Kokoro

  • Engine: kokoro
  • Model: hexgrad/Kokoro-82M (through kokoro package)
  • Best language: English
  • Voice IDs in this app:
    • Female adult: af_heart, af_bella, af_nicole, af_sarah
    • Male adult: am_adam, am_eric, am_michael
    • British female adult: bf_emma, bf_isabella
    • British male adult: bm_george, bm_lewis

XTTS v2 (multilingual)

  • Engine: xtts
  • Model ID: tts_models/multilingual/multi-dataset/xtts_v2
  • Supported in this app: English (en), Spanish (es), German (de), Hungarian (hu)
  • Speaker presets (examples):
    • Female adult: Ana Florence, Claribel Dervla, Daisy Studious, Gracie Wise, Tammie Ema
    • Male adult: Alfie, Albert, Andrew, Brandon, Manuel

Notes:

  • No preset is explicitly tagged as “old”.
  • You can inspect available models/voices from CLI:
book2speech --list-models
book2speech --engine kokoro --list-voices
book2speech --engine xtts --list-voices

Setup

cd /home/asura/repos/tts
  - `.mobi` *(via pure Python library, no installation needed)*
  - `.azw`, `.azw3` *(via Calibre conversion, optional)*

Optional package install:

pip install -e .

Can I run it without installing the package?

Yes.

After dependency install, run directly from source:

python -m book2speech.cli ./my_book.epub --output ./audiobooks
python -m book2speech.web

CLI usage examples

Basic:

book2speech ./my_book.epub --output ./audiobooks

Export only selected chapters:

book2speech ./books/dune.epub --chapters 1,3,5-8 --output ./audiobooks

Export only selected PDF pages (then chapter-split inside that subset):

book2speech ./books/scan.pdf --pages 10-40,55 --output ./audiobooks

Expressive Parler (English):

book2speech ./books/dune.epub \
  --engine parler \
  --style "A warm, immersive narrator, expressive but controlled, clear diction, subtle dramatic emphasis." \
  --max-chars 850 \
  --format mp3 \
  --output ./audiobooks

Kokoro:

book2speech ./my_book.txt \
  --engine kokoro \
  --voice af_heart \
  --speed 1.0 \
  --format wav \
  --output ./audiobooks

Spanish (XTTS):

book2speech ./books/novela.epub \
  --engine xtts \
  --language es \
  --voice "Ana Florence" \
  --format mp3 \
  --output ./audiobooks

German (XTTS):

book2speech ./books/roman.epub \
  --engine xtts \
  --language de \
  --voice "Albert" \
  --format mp3 \
  --output ./audiobooks

Hungarian (XTTS):

book2speech ./books/regeny.epub \
  --engine xtts \
  --language hu \
  --voice "Gracie Wise" \
  --format mp3 \
  --output ./audiobooks

Web UI

Start:

book2speech-web

Open http://localhost:7860, then:

  • upload a book file
  • choose engine (parler, kokoro, or xtts)
  • set voice/style/speed
  • set language (en, es, de, hu) when using XTTS
  • choose output format (wav or mp3)
  • optionally filter chapters (1,3,5-8)
  • optionally filter PDF pages (1-20,25)
  • generate audio, preview chapters, download ZIP

Output

For a book titled My Story:

  • output/my-story/001_Chapter 1.wav (or .mp3)
  • output/my-story/002_Chapter 2.wav (or .mp3)
  • output/my-story/manifest.json

Notes on AZW/AZW3/MOBI

AZW-family formats are converted via Calibre ebook-convert first.

Install Calibre and ensure ebook-convert is available in shell PATH.

DRM-protected books generally cannot be processed.

Practical quality tips

  • For English expressive narration, use parler or kokoro.
  • For Spanish/German/Hungarian, prefer xtts with --language es|de|hu.
  • Tune chunking with --max-chars for cadence.
  • GPU is strongly recommended for speed.
  • MP3 export requires ffmpeg in system PATH.

Contributors

BKris2315

1 commits

Languages

Python

89.5%

Jupyter Notebook

10.5%