Skip to main content

Convert serialized EPUB books into M4B audiobooks with Chatterbox Multilingual TTS.

Project description

chatterbook

Convert EPUB books into M4B audiobooks with Chatterbox Multilingual TTS.

from chatterbook import Book

book = Book("book.epub")
book.convert(
    language="ko",
    voice_path="voices/narrator.wav",
    style="warm",
    batch_size=8,
    speed=0.9,
)

Book reads the EPUB immediately and builds a JSON-compatible representation with title, chapters, paragraphs, narration/dialogue segments, and pause timing. You can serialize and restore that representation without reading the EPUB again:

data = book.to_dict()
book = Book.from_dict(data)
book.convert("audiobooks/book.m4b", language="ko")

By default, the output filename is read from the EPUB title metadata and written as Title.m4b in the current directory. You can also pass a path or directory.

voice_path is an optional short WAV reference clip for voice cloning. If it is omitted, Chatterbox's bundled default conditionals are used.

Chapters are split into paragraph and speech segments when the Book is built. Adjacent narration or dialogue sentences are compacted up to max_chars so TTS uses fewer calls while still keeping narration/dialogue boundaries. Quoted dialogue is marked separately and generated with slightly more expressive settings. Commas, sentence endings, paragraph breaks, and narration/dialogue transitions add short pauses to improve audiobook pacing.

The default audiobook pacing is intentionally slower than raw TTS:

  • speed=0.9
  • comma_pause_ms=120
  • sentence_pause_ms=300
  • paragraph_pause_ms=600
  • dialogue_pause_ms=300

M4B output requires ffmpeg on your PATH. During conversion, chatterbook shows one colored tqdm progress bar for the whole EPUB. Pass show_progress=False to disable it.

When voice_path is used, conversion prepares voice conditionals once per same-style batch instead of once per segment. Tune batch_size to control how many adjacent narration or dialogue segments are grouped for that preparation step.

To export chapter WAV files instead of one M4B:

book.convert(
    "audio",
    language="ko",
    output_format="wav",
)

Styles

  • neutral: balanced default
  • warm: slightly softer narration
  • dramatic: more expressive narration

You can override a style with explicit generation values:

book.convert(
    language="ko",
    exaggeration=0.7,
    cfg_weight=0.3,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatterbook-0.4.2.tar.gz (232.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatterbook-0.4.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file chatterbook-0.4.2.tar.gz.

File metadata

  • Download URL: chatterbook-0.4.2.tar.gz
  • Upload date:
  • Size: 232.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatterbook-0.4.2.tar.gz
Algorithm Hash digest
SHA256 c13a37aefd772d4f26d7d10c673a818f7f0176f60ff0a0bf406e7e3657f70e2a
MD5 b02a4a21306f85a79fbeb7d954600b45
BLAKE2b-256 4be17f8e86694d06340e372147d8915b79b37e8fcb761ba33bae925ce6cbbc35

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatterbook-0.4.2.tar.gz:

Publisher: workflow.yml on smturtle2/chatterbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chatterbook-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: chatterbook-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatterbook-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74c0c94998fb49ef4ba9cb27e01dd0c4008df043ee484837f1e041339e0390f0
MD5 58586c580f155d7fb52796450f0f8bfc
BLAKE2b-256 367f8d0c1c5493c67b77167fa3c70d65ef0be7661ef92f3e9b63d0ebd7e0a2b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatterbook-0.4.2-py3-none-any.whl:

Publisher: workflow.yml on smturtle2/chatterbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page