https://github.com/firedev/epub2audiobook
Convert EPUB books to audiobooks using Microsoft Edge TTS. Free, no API key required.
https://github.com/firedev/epub2audiobook
Last synced: 17 days ago
JSON representation
Convert EPUB books to audiobooks using Microsoft Edge TTS. Free, no API key required.
- Host: GitHub
- URL: https://github.com/firedev/epub2audiobook
- Owner: firedev
- License: mit
- Created: 2026-02-24T08:26:20.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-24T10:49:42.000Z (4 months ago)
- Last Synced: 2026-02-24T14:40:12.304Z (4 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# epub2audiobook
Convert EPUB books to audiobooks using Microsoft Edge TTS. Free, no API key required.
Designed for Russian-language books but works with any language supported by Edge TTS.
## Install
### macOS
```bash
brew install python ffmpeg
git clone https://github.com/firedev/epub2audiobook.git
cd epub2audiobook
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
### Linux (Debian/Ubuntu)
```bash
sudo apt install python3 python3-venv ffmpeg
git clone https://github.com/firedev/epub2audiobook.git
cd epub2audiobook
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Usage
```bash
# Russian male voice (default)
python epub2audio.py book.epub
# Russian female voice
python epub2audio.py book.epub --voice ru-RU-SvetlanaNeural
# Custom output directory
python epub2audio.py book.epub --output ./my_audiobook
# Faster speech
python epub2audio.py book.epub --rate "+15%"
# Chapter files only, no combined file
python epub2audio.py book.epub --no-merge
```
## Options
| Flag | Default | Description |
|------|---------|-------------|
| `epub_file` | required | Path to .epub file |
| `--voice` | `ru-RU-DmitryNeural` | Edge TTS voice ID |
| `--output` | `./output` | Output directory |
| `--no-merge` | false | Keep individual chapter files only, don't concatenate into one MP3 |
| `--rate` | `+0%` | Speech rate (`+10%`, `-5%`, etc.) |
## Chapter splitting
Chapters are split using the EPUB's NCX table of contents, which provides anchor-level granularity. A single HTML file containing multiple chapters (common in FB2-converted EPUBs) is split at each TOC anchor point. Section titles from the TOC (story names, part headings) are preserved as separate short chapters. Falls back to spine-based splitting when no TOC is present.
## Output
```
output/
book-name/
01_Chapter_One.mp3
02_Chapter_Two.mp3
...
book-name_complete.mp3 # all chapters merged
```
Re-running is safe — existing chapters and chunks are skipped (0-byte files from failed runs are re-generated). If a network error interrupts conversion, re-run the same command and it picks up from the last successful chunk.
## Voices
Russian voices:
- `ru-RU-DmitryNeural` — male, clear, neutral
- `ru-RU-SvetlanaNeural` — female, clear, neutral
List all available voices:
```bash
edge-tts --list-voices | grep ru-RU
```
Works with any Edge TTS voice. For English: `en-US-GuyNeural`, `en-US-JennyNeural`, etc.
## Requirements
- Python 3.10+
- ffmpeg (for concatenating chapter MP3s)
## License
MIT