ebook2audiobook (E2A) is an open-source project designed to convert ebooks into audiobooks. It supports multiple TTS (text-to-speech) engines, including XTTSv2, Bark, Fairseq, VITS, Tacotron2, Tortoise, GlowTTS, and YourTTS, and supports voice cloning and 1158 languages. This tool is only suitable for non-DRM, legally obtained ebooks, and the author assumes no responsibility for any misuse or legal consequences.
Purpose: Convert ebooks into audiobooks, with the option to clone your own voice or use preset voices.
Main capabilities:
- Supports multiple ebook formats: .epub, .mobi, .azw3, .fb2, .lrf, .rb, .snb, .tcr, .pdf, .txt, .rtf, .doc, .docx, .html, .odt, .azw, .tiff, .tif, .png, .jpg, .jpeg, .bmp, .zip.
- Supports OCR scanning and can process text in images.
- Supports voice cloning, allowing you to use your own voice files.
- Supports 1158 languages.
- Low resource usage, and can run with a minimum of 2GB RAM and 1GB VRAM.
- Output formats: mono or stereo aac, flac, mp3, m4b, m4a, mp4, mov, ogg, wav, webm.
- Supports SML tags, allowing control of pauses, breaks, voice switching, and more.
- Supports custom models (XTTSv2, VITS, FAIRSEQ, PIPER, etc.).
- Provides pretrained fine-tuned models.
How to use:
- Run locally: through the Gradio web interface or in command-line headless mode.
- Clone the repository: git clone https://github.com/DrewThomasson/ebook2audiobook.git and enter the directory.
- Install/run: on Linux/MacOS use ./ebook2audiobook.command; on Windows use ebook2audiobook.cmd.
- Open the Web app: visithttp://localhost:7860/。
- Public link: ./ebook2audiobook.command --share (Linux/MacOS) or ebook2audiobook.cmd --share (Windows) or python app.py --share (all systems).
- Headless mode: ./ebook2audiobook.command --headless --ebook <path> --voice <path> --language <code> (Linux/MacOS) or ebook2audiobook.cmd --headless --ebook <path> --voice <path> --language <code> (Windows).
- Custom model: --custom_model <path>, which must be a .zip file containing the necessary files.
- View more help: ./ebook2audiobook.command --help (Linux/MacOS) or ebook2audiobook.cmd --help (Windows) or python app.py --help.
- Run remotely: you can build and run a container via Docker.
Use cases:
- Convert ebooks you personally and legally own into audiobooks for easier listening.
- Users who need multilingual speech synthesis or voice cloning.
- Users who want to run locally and value privacy.
- Developers and researchers can customize TTS models or contribute code.
Limitations:
- Only suitable for non-DRM, legally obtained ebooks.
- The EPUB format lacks a standard structure, so unwanted text must be manually removed before conversion.
- Modern TTS engines run slowly on CPU, so using a GPU is recommended.
- The ideal reference audio length for voice cloning is 1 to 5 minutes, and background noise or music will be cleaned up.
- The built-in cloned voice list is mainly English; other languages need to be added by contacting the author.
- Some features (such as batch conversion and an Android app) are still on the roadmap.
- Requires virtualization support (Windows Docker) or specific hardware (CUDA, ROCm, MPS, etc.).
- Support for more platforms and models is under development.