AI Audiobook Generator - Convert books to narrated audiobooks
Project description
Audiobooker
AI Audiobook Generator - Convert EPUB/TXT books into professionally narrated audiobooks using multi-voice synthesis.
Features
- Multi-voice synthesis: Assign unique voices to each character
- Dialogue detection: Automatically identifies quoted dialogue vs narration
- Review-before-render: Human-editable review format for correcting attributions
- Chapter management: Preserves book structure with chapter markers
- Flexible casting: Manual voice assignment with emotion control
- M4B output: Professional audiobook format with chapter navigation
- Project persistence: Save/resume rendering sessions
Installation
# Clone and install
git clone https://github.com/mcp-tool-shop/audiobooker
cd audiobooker
pip install -e .
# Required: voice-soundboard for TTS
pip install -e ../voice-soundboard
# Required: FFmpeg for audio assembly
# Windows: winget install ffmpeg
# Mac: brew install ffmpeg
# Linux: apt install ffmpeg
Quick Start
# 1. Create project from EPUB
audiobooker new mybook.epub
# 2. Assign voices to characters
audiobooker cast narrator bm_george --emotion calm
audiobooker cast Alice af_bella --emotion warm
audiobooker cast Bob am_michael --emotion grumpy
# 3. Compile and review
audiobooker compile
audiobooker review-export # Creates mybook_review.txt
# 4. Edit the review file to fix attributions, then import
audiobooker review-import mybook_review.txt
# 5. Render
audiobooker render
Review Workflow (v0.2.0)
The review workflow lets you inspect and correct the compiled script before rendering:
# Export to review format
audiobooker review-export
# Edit the file (example: mybook_review.txt)
# === Chapter 1 ===
#
# @narrator
# The door creaked open.
#
# @Unknown <-- Change this to @Marcus
# "Hello?" he whispered.
#
# @Sarah (worried) <-- Emotions are preserved
# "Is anyone there?"
# Import corrections
audiobooker review-import mybook_review.txt
# Render with corrected attributions
audiobooker render
Review file format:
=== Chapter Title ===- Chapter markers@Speakeror@Speaker (emotion)- Speaker tags# comment- Comments (ignored on import)- Delete blocks to remove unwanted utterances
- Change
@Unknownto@ActualNameto fix attribution
Python API
from audiobooker import AudiobookProject
# Create from EPUB
project = AudiobookProject.from_epub("mybook.epub")
# Cast voices
project.cast("narrator", "bm_george", emotion="calm")
project.cast("Alice", "af_bella", emotion="warm")
# Compile (detect dialogue, attribute speakers)
project.compile()
# Review workflow
review_path = project.export_for_review()
# ... edit the file ...
project.import_reviewed(review_path)
# Render to M4B
project.render("mybook.m4b")
# Save project for later
project.save("mybook.audiobooker")
Casting Table
The casting table maps characters to voices:
# Cast with emotion
project.cast("Gandalf", "bm_george", emotion="wise", description="Ancient wizard")
# Cast dialogue character
project.cast("Frodo", "am_adam", emotion="nervous")
# Unknown speakers fall back to narrator
project.casting.unknown_character_behavior = "narrator"
Inline Overrides
Override voice/emotion for specific passages in your source text:
[Alice|angry] "How dare you!"
[Bob|whisper] "Shh, they'll hear us."
[narrator] The tension was palpable.
Dialogue Detection
Audiobooker uses heuristics to detect dialogue:
- Text in "double quotes" (or smart quotes) -> dialogue
- Attribution patterns: "said Alice", "Bob whispered" -> speaker detection
- Everything else -> narrator
For best results, ensure your source text has properly formatted dialogue.
CLI Commands
| Command | Description |
|---|---|
audiobooker new <file> |
Create project from EPUB/TXT |
audiobooker cast <char> <voice> |
Assign voice to character |
audiobooker compile |
Compile chapters to utterances |
audiobooker review-export |
Export script for human review |
audiobooker review-import <file> |
Import edited review file |
audiobooker render |
Render audiobook |
audiobooker info |
Show project information |
audiobooker voices |
List available voices |
audiobooker chapters |
List chapters |
audiobooker speakers |
List detected speakers |
Project File Format
Projects are saved as JSON (.audiobooker):
{
"schema_version": 1,
"title": "My Book",
"author": "Author Name",
"chapters": [...],
"casting": {
"characters": {
"narrator": {"voice": "bm_george", "emotion": "calm"},
"alice": {"voice": "af_bella", "emotion": "warm"}
}
}
}
Requirements
- Python 3.10+ (3.11 recommended for voice-soundboard compatibility)
- voice-soundboard - TTS engine
- FFmpeg - Audio assembly
- ebooklib - EPUB parsing
Architecture
audiobooker/
├── parser/ # EPUB, TXT parsing
├── casting/ # Dialogue detection, voice assignment
├── renderer/ # Audio synthesis
├── review.py # Review format export/import
└── cli.py # Command-line interface
Flow:
Source File -> Parser -> Chapters -> Dialogue Detection ->
Utterances -> Review/Edit -> TTS (voice-soundboard) ->
Chapter Audio -> FFmpeg -> M4B with Chapters
Roadmap
- v0.1.0 - Core pipeline (parse, cast, compile, render)
- v0.2.0 - Review-before-render workflow
- v0.3.0 - BookNLP integration for speaker suggestions
- v0.4.0 - Voice suggestion based on character traits
- v0.5.0 - Emotion inference from context
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file audiobooker_ai-0.2.1.tar.gz.
File metadata
- Download URL: audiobooker_ai-0.2.1.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9a67955148f8c4fef0f7baaa1a45ae2d5a28a143f5499d793765fcaf3301209
|
|
| MD5 |
242ed8fca03530c802e2fc98f60015bb
|
|
| BLAKE2b-256 |
6d6543b1c0c4a8e98d8baad1d3a81f714a2a6923605797f7eb49e6e22912cc1b
|
File details
Details for the file audiobooker_ai-0.2.1-py3-none-any.whl.
File metadata
- Download URL: audiobooker_ai-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0d32efd08b409c3d47e148e6e99e4131a57331e5f592823b46f2cbb08cd2e19
|
|
| MD5 |
2024dca8021e3e1b102635be11faf410
|
|
| BLAKE2b-256 |
7a0ae4ea9e7c675938effe9feba1a4ac5cbeabbc246bc6872affe8ece65129d3
|