Model or dataset
p0n1/epub_to_audiobook avatar
p0n1/epub_to_audiobook

p0n1/epub_to_audiobook: an EPUB to audiobook converter built for Audiobookshelf

EPUB to audiobook converter, optimized for Audiobookshelf, WebUI included

2,067 stars222 forksPythonMIT

At a glance

What is it?
A Python CLI and Gradio WebUI that turns each EPUB chapter into a separate MP3 with chapter metadata, using Azure, Edge, OpenAI, Piper or Kokoro TTS. It is a solid fit if you already run Audiobookshelf and want per-chapter files, and the wrong tool if you expect clean chapter titles from every EPUB.
Who is it for?
Adopt p0n1/epub_to_audiobook if you run Audiobookshelf, want one MP3 per chapter with title metadata, and are willing to supply an Azure key, an OpenAI key, or use Edge TTS with no key at all. Skip it if you need a hosted service, an iPhone or iPad app, or a single-file audiobook, because this repository ships a Python CLI and a local Gradio WebUI only.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 176 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap p0n1/epub_to_audiobook fills between an EPUB and an Audiobookshelf library

Most EPUB to audio pipelines produce one long file. Audiobookshelf, however, is built around chapters, and it reads chapter titles from file metadata. p0n1/epub_to_audiobook targets that specific shape: the README states that each chapter in the EPUB is converted into a separate MP3 file, with the chapter title extracted and included as metadata. That is the whole design premise, and it explains why the project exists next to generic text-to-speech tooling.

The intended user is someone who already self-hosts Audiobookshelf and has EPUB files they want to listen to. The README does not present this as a service for casual readers. It assumes you can run Python 3.10+ or Docker, and that you can obtain either a Microsoft Azure Cognitive Services Speech key, an OpenAI API key, or nothing at all if you pick Edge TTS. If you only want to listen to a book on your phone without touching a terminal, this is not aimed at you.

How the converter turns chapters into MP3 files with metadata

The pipeline is linear. The tool parses the EPUB, walks its chapters, sends the text of each chapter to a TTS provider, and writes the resulting audio as a separate MP3 per chapter. The README describes the output as optimized for Audiobookshelf, and the repository layout supports that reading: main.py is the command-line entry point, main_ui.py is the Gradio interface, and the audiobook_generator/ package holds the conversion logic.

Chapter titles are the interesting part. The README is candid that parsing and extracting titles is hard because EPUB structure varies. The method used is to look for the title tag in the HTML content of each chapter. When that tag is missing, the tool falls back to generating a title from the first few words of the chapter text. That fallback is a reasonable default, but it means a badly structured book can end up with chapter names that are just the opening sentence fragment.

Provider support is where the project has grown. The README lists Microsoft Azure TTS, EdgeTTS as an alternative to Azure, the OpenAI TTS API, Piper TTS through a local executable and models, and Kokoro TTS routed through a local OpenAI-compatible endpoint. The repository also ships docker-compose.kokoro-example.yml, which matches that last path. The dependency list in requirements.txt includes edge-tts, openai, pydub, EbookLib, beautifulsoup4, mutagen and sentencex, which is consistent with a design that parses EPUBs, splits text into sentences, calls a remote or local TTS API, and writes tagged MP3s.

Installing p0n1/epub_to_audiobook and producing your first chapter MP3

The README gives a clone, virtual environment and pip path. Python 3.10 or newer is required, or Docker. After cloning, create the environment and install the pinned dependencies:

bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

The README carries a warning worth reading before you pin anything: Python 3.14 requires the updated dependency set in the repository, and older installs pinned gradio==5.33.1, which could force a pydantic-core source build and fail with a PyO3 compatibility error. The current requirements.txt pins gradio==5.50.0. If your install fails on pydantic-core, that note is the first thing to check.

Next, set credentials for the provider you intend to use. Edge TTS needs no key, which makes it the cheapest way to try the tool:

bash
export MS_TTS_KEY=<your_subscription_key>   # for Azure
export MS_TTS_REGION=<your_region>          # for Azure
export OPENAI_API_KEY=<your_openai_api_key> # for OpenAI

If you prefer a graphical flow, launch the Gradio interface. The README states it is available at http://127.0.0.1:7860 by default, and that host and port can be changed:

bash
python3 main_ui.py
python3 main_ui.py --host 127.0.0.1 --port 8080

Inside the WebUI the README describes file upload by drag and drop, provider tabs for OpenAI, Azure, Edge and Piper, dropdowns for language, voice and output format, provider-specific options such as speed, break duration, rate, volume and pitch, real-time logs, a Preview Mode that tests settings without generating audio, and search and replace via an uploaded text replacement file for pronunciation fixes. For a first run, upload a book, pick Edge TTS, and use Preview Mode before committing to a full conversion. The example EPUB in the repository is examples/The_Life_and_Adventures_of_Robinson_Crusoe.epub if you want a known input.

Docker is the other route. The Dockerfile installs ffmpeg, copies requirements.txt first for layer caching, installs dependencies, then switches to /app as the working directory. The comment in the Dockerfile explains the split: code lives in /app_src so that mounting a local directory at /app does not override the code inside the container. The repository provides docker-compose.example.yml, docker-compose.webui.yml and docker-compose.kokoro-example.yml. The README does not spell out the compose workflow in the excerpt shown, so read those files directly before running them.

Where the chapter title heuristic and the provider keys break down

The chapter title method is the most obvious weak point, and the README says so: the approach may not work perfectly for all EPUB files, especially those with complex or unusual formatting. Books that put chapter headings in styled divs, images, or unusual markup will fall through to the first-few-words fallback. You will not get an error. You will get a plausible-looking title that is actually a sentence fragment, and you will only notice it after the audio is generated.

The second constraint is credentialing. Azure and OpenAI both require accounts and keys, which means cost and rate limits that the README does not quantify. Kokoro is a special case: the README notes that if you use Kokoro TTS you do not need an official OpenAI key, but you do need to put a dummy value in the environment, for example export OPENAI_API_KEY='fake', unless you are using the docker compose file. That is a small trap for anyone wiring Kokoro into an existing environment where a real key is already set.

Third, this is a local tool. There is no hosted version in the README, no iOS or iPhone app, and no single-file audiobook output described. If your library workflow depends on a web service or a mobile app, the project does not meet that need. Piper additionally requires a local executable and models, which is a manual setup step outside pip.

How p0n1/epub_to_audiobook differs from a generic EPUB to speech pipeline

The closest comparison is a general-purpose text-to-speech pipeline: extract the EPUB text, feed it to a TTS engine, and write one audio file. That approach works and is often simpler, but it produces a monolithic file. Audiobookshelf can still play it, though you lose chapter-level navigation and metadata unless you post-process the file yourself.

p0n1/epub_to_audiobook makes the opposite trade. It does more work up front, splitting by chapter and extracting titles, and it accepts the risk that title extraction is heuristic. In exchange, the output drops into Audiobookshelf with chapter names already attached, which is exactly what the README promises and what the examples/audiobookshelf.png screenshot illustrates.

The provider abstraction is the other difference. Rather than committing to one engine, the tool exposes Azure, Edge, OpenAI, Piper and Kokoro behind the same conversion flow, with the WebUI offering tabs per provider. That means you can start on Edge TTS with no key and move to Azure or OpenAI later without changing your library layout. A single-engine script would not give you that path.

Maintenance, licence and what upgrading costs you

The repository is not archived. Its last push was on 2026-03-24, which is roughly six months before today, so it sits at the edge of what most people would call current. The most recent release listed is v0.8.7 from 2026-02-03, with v0.8.6 the same day and v0.8.5 from 2025-08-29. The README's Recent Updates section records one notable feature addition, the WebUI, on 2025-05-23. Beyond that, the changelog detail available here is thin, so treat release cadence as modest rather than fast.

The practical upgrade cost is dependency churn. requirements.txt pins exact versions across twelve packages, including gradio, openai, edge-tts and EbookLib. The README's note about gradio==5.33.1 causing a pydantic-core source build failure on Python 3.14 shows how a single pin can break installation. Upgrading means re-testing that set, not just pulling the latest commit.

The project is MIT licensed. That is permissive and permits commercial use and modification, but this is not legal advice and the repository does not include a separate notice about the TTS providers' own terms. Azure, OpenAI and the voice models you select each carry their own usage conditions, which are outside the scope of the MIT grant.

Editorial conclusion

Adopt p0n1/epub_to_audiobook if you run Audiobookshelf, want one MP3 per chapter with title metadata, and are willing to supply an Azure key, an OpenAI key, or use Edge TTS with no key at all. Skip it if you need a hosted service, an iPhone or iPad app, or a single-file audiobook, because this repository ships a Python CLI and a local Gradio WebUI only. Before converting a full library, run one book with the WebUI's Preview Mode and check the chapter titles, since the README states the title extraction method may not work for EPUBs with complex or unusual formatting.

Frequently asked questions

What is p0n1/epub_to_audiobook and who is it for?

It is a command-line tool that converts EPUB ebooks into audiobooks, with a Gradio WebUI added in May 2025. The README describes the output as optimized for Audiobookshelf, so it suits self-hosters who already run that server and want chapter-level files.

How do I install p0n1/epub_to_audiobook?

The README gives a clone, then python3 -m venv venv, source venv/bin/activate, and pip install -r requirements.txt. Python 3.10 or newer is required, or you can use Docker; the repository includes a Dockerfile and several docker-compose example files.

Does p0n1/epub_to_audiobook need an API key?

It depends on the provider. Azure needs MS_TTS_KEY and MS_TTS_REGION, OpenAI needs OPENAI_API_KEY, and Edge TTS requires no API key at all. For Kokoro TTS the README says you can set a dummy value such as export OPENAI_API_KEY='fake' unless you use the docker compose file.

How does p0n1/epub_to_audiobook handle chapter titles?

It parses the EPUB and looks for the title tag in each chapter's HTML. If that tag is missing, it generates a fallback title from the first few words of the chapter text, and the README notes this may not work for EPUBs with complex or unusual formatting.

Which text-to-speech providers does p0n1/epub_to_audiobook support?

The README lists Microsoft Azure TTS, EdgeTTS as an Azure alternative, the OpenAI TTS API, Piper TTS with a local executable and models, and Kokoro TTS through a local OpenAI-compatible endpoint. The WebUI exposes these as tabs with provider-specific options.

How do I start the p0n1/epub_to_audiobook web interface?

Run python3 main_ui.py after completing the installation steps. The README states the WebUI is available at http://127.0.0.1:7860 by default, and that you can change it with --host and --port, for example python3 main_ui.py --host 127.0.0.1 --port 8080.

Official sources

  1. License: MIT
  2. p0n1/epub_to_audiobook on GitHub
  3. Project website
  4. README
  5. Releases
Community notes

Community notes