epub_to_audiobook

EPUB to audiobook converter, optimized for Audiobookshelf, WebUI included

What is epub_to_audiobook?

EPUB to audiobook converter, optimized for Audiobookshelf, WebUI included

Overview of epub_to_audiobook

What it is

EPUB to Audiobook Converter is a command-line tool that converts EPUB ebooks into audiobooks. It supports multiple text-to-speech (TTS) providers, including Microsoft Azure TTS, EdgeTTS, OpenAI TTS, Piper TTS, and Kokoro TTS (via a local OpenAI endpoint). The output audio files are optimized for use with Audiobookshelf, with each chapter converted into a separate MP3 file and chapter titles extracted as metadata. The project also includes a web-based user interface (WebUI) built with Gradio.

Key features

  • Supports multiple TTS providers: Azure, OpenAI, Edge, Piper, and Kokoro
  • WebUI built with Gradio for graphical configuration and conversion
  • Chapter title extraction from EPUB files for Audiobookshelf navigation
  • Preview mode to test settings without generating full audio
  • Search and replace functionality for pronunciation fixes via text replacement files
  • Real-time log viewer in the WebUI
  • Docker support for easy deployment
  • Command-line options for fine-grained control (chapter range, voice, output format, etc.)

Use cases

  • Converting personal EPUB ebooks into audiobooks for listening on the go
  • Integrating with Audiobookshelf to create a seamless audiobook library
  • Batch conversion of multiple chapters with metadata preservation
  • Testing different TTS voices and providers before committing to a full conversion

Getting started

Clone the repository and install dependencies:

git clone https://github.com/p0n1/epub_to_audiobook.git
cd epub_to_audiobook
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Set environment variables for your TTS provider (example for Azure and OpenAI):

export MS_TTS_KEY=your_azure_key
export MS_TTS_REGION=your_azure_region
export OPENAI_API_KEY=your_openai_key

To start the WebUI:

python3 main_ui.py

The WebUI will be available at http://127.0.0.1:7860 by default.

License and pricing

This project is open source under the MIT license. No pricing information is stated beyond the open source nature.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/p0n1epub-to-audiobook.svg)](https://yunodb.com/tools/p0n1epub-to-audiobook?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/p0n1epub-to-audiobook?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/p0n1epub-to-audiobook.svg" alt="Featured on YunoDB" height="20"></a>