https://github.com/drewthomasson/ebook2audiobookstyletts2
This simple program makes use of Calibre to convert a ebook into chapters and styletts2 to turn that into a audiobook with voice cloning capabilities
https://github.com/drewthomasson/ebook2audiobookstyletts2
audiobook-creator audiobooks docker epub styletts2 tts
Last synced: about 2 months ago
JSON representation
This simple program makes use of Calibre to convert a ebook into chapters and styletts2 to turn that into a audiobook with voice cloning capabilities
- Host: GitHub
- URL: https://github.com/drewthomasson/ebook2audiobookstyletts2
- Owner: DrewThomasson
- License: mit
- Created: 2024-01-22T04:47:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-30T04:55:12.000Z (about 1 year ago)
- Last Synced: 2025-04-17T00:18:00.493Z (6 months ago)
- Topics: audiobook-creator, audiobooks, docker, epub, styletts2, tts
- Language: Python
- Homepage:
- Size: 995 KB
- Stars: 23
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ebook_to_audiobook_styletts
This program uses Calibre for converting eBooks into chapters and StyleTTS2 to transform these chapters into an audiobook.
It features text-to-speech technology with an optional voice cloning capability if a voice file is provided.
## Demohttps://github.com/DrewThomasson/ebook2audiobookSTYLETTS2/assets/126999465/b55f9fe8-98d1-41ab-a585-3c5b99f9b39f
### Supported ebook File Types:
.epub, .pdf, .mobi, .txt, .html, .rtf, .chm, .lit, .pdb, .fb2, .odt, .cbr, .cbz, .prc, .lrf, .pml, .snb, .cbc, .rb, and .tcr,
(Best results are from using epub or mobi for auto chapter detection)### outputs as a m4b with all book metadata and chapters, example output file in an audiobook player app
## Gradio Web GUI
![]()
## Features
- Converts eBooks to text format using Calibre's `ebook-convert` tool.
- Splits the eBook into chapters for easier processing.
- Utilizes `StyleTTS2` for converting each chapter into an audio file.
- Offers an optional voice cloning feature when provided with a voice file.## 🚀 Docker Quick Start 🐳
To quickly get started with this eBook to Audiobook converter, simply run the following Docker command:
To run the Docker container and start the Gradio interface, use the following command:
To run with a gpu
```powershell
docker run -it --rm --gpus all -p 7860:7860 athomasson2/ebook2audiobookstyletts2:latest
```To run without a gpu
```powershell
docker run -it --rm -p 7860:7860 athomasson2/ebook2audiobookstyletts2:latest
```
This will start the Gradio interface on port `7860`. You can access it by navigating to `http://localhost:7860` in your web browser.## Requirements
- Python 3.10
- `styletts2` Python package
- Calibre (for eBook conversion)
- FFmpeg (for audiobook file creation)
- Optional: Voice file for voice cloning
- 4gb ram### Installation Instructions for Dependencies
- Install Python 3.x from [Python.org](https://www.python.org/downloads/).
- Calibre:
- Ubuntu: `sudo apt-get install -y calibre`
- macOS: `brew install calibre`
- Windows(Powershell in Administrator mode): `choco install calibre`
- FFmpeg:
- Ubuntu: `sudo apt-get install -y ffmpeg`
- macOS: `brew install ffmpeg`
- Windows(Powershell in Administrator mode)s: `choco install ffmpeg`
- Python packages:
```bash
pip install styletts2 pydub nltk beautifulsoup4 ebooklib tqdm
## UsageNavigate to the script's directory in the terminal and use one of the following commands:
### Without Voice Cloning:
```bash
python styletts_to_ebook.py
```
Replace with the path to your eBook file.### With Voice Cloning:
```bash
python styletts_to_ebook.py
```
Replace with the path to your eBook file.Replace with the path to the voice file for cloning.