# abogen

> Drop in an ePub, PDF or subtitle file and get a narrated audiobook with synchronised captions out the other side

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: MIT
- Repository: https://github.com/denizsafak/abogen
- Website: https://pypi.org/project/abogen/
- Canonical page: https://ai-tldr.dev/tools/abogen/

## In short

abogen is a desktop text-to-speech tool that turns ePub, PDF, plain text, markdown and subtitle files into narrated audio with matching subtitles. It runs the Kokoro-82M model locally, so a whole book is converted on your own machine without a per-character API bill or an upload step. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed MIT.

## Overview

abogen is a desktop text-to-speech tool that turns ePub, PDF, plain text, markdown and subtitle files into narrated audio with matching subtitles. It runs the Kokoro-82M model locally, so a whole book is converted on your own machine without a per-character API bill or an upload step. Output can be a single file or one file per chapter, in WAV, FLAC, MP3, Opus, or M4B with chapter markers.

The interesting part for most users is the caption side: abogen emits subtitles alongside the audio at a granularity you choose — per line, per sentence, per sentence-plus-comma, or in fixed groups of one, two, three or more words — in SRT or several ASS layouts. That makes it as useful for captioned short-form video voiceover as it is for long-form audiobooks.

Two interfaces ship in the same package and they are not identical. `abogen` opens a PyQt6 desktop GUI with the stable core feature set; `abogen-web` starts a Flask web UI that carries newer work, including Supertonic TTS, LLM-based text normalisation and Audiobookshelf integration, which the project is still folding back into the desktop app. abogen is MIT-licensed, published on PyPI, and runs on Windows, macOS and Linux with optional CUDA or ROCm acceleration. It depends on espeak-ng, which is installed separately.

## What it does

- Reads ePub, PDF, TXT, Markdown, SRT, ASS and VTT input, or text typed into the built-in editor
- Local synthesis with Kokoro-82M — no hosted API call and no per-character cost
- Synchronised subtitles at a granularity you pick: line, sentence, sentence + comma, or fixed 1/2/3-word groups, in SRT or four ASS layouts
- Chapter handling for books: choose chapters (or chapters + pages for PDFs), save each as its own file, merge them, or emit M4B with chapter markers
- Voice mixer for blending voice models into a saved custom profile, with preview before you commit to a long run, and speech rate from 0.1x to 2.0x
- Queue mode for batch conversion with per-file settings; a web UI (`abogen-web`) adds Supertonic TTS, LLM normalisation and Audiobookshelf integration

## Getting started

abogen installs from PyPI. espeak-ng is a separate prerequisite on every platform, and the GPU variant you install depends on your hardware.

1. Install espeak-ng

   On Windows, download and run the .msi from the espeak-ng releases page. On macOS and Linux, use the package manager.

```bash
# macOS
brew install espeak-ng

# Linux
sudo apt install espeak-ng    # Ubuntu/Debian
sudo pacman -S espeak-ng      # Arch
sudo dnf install espeak-ng    # Fedora
```

2. Install abogen

   The README recommends uv. Pick the extra that matches your GPU — the plain install covers CPU and, on Linux, NVIDIA.

```bash
# NVIDIA on Windows (CUDA 12.8)
uv tool install --python 3.12 abogen[cuda] \
  --extra-index-url https://download.pytorch.org/whl/cu128 \
  --index-strategy unsafe-best-match

# CPU, or NVIDIA on Linux
uv tool install --python 3.12 abogen

# AMD on Linux (ROCm 6.4)
uv tool install --python 3.12 abogen[rocm] \
  --extra-index-url https://download.pytorch.org/whl/nightly/rocm6.4 \
  --index-strategy unsafe-best-match
```

3. Run one of the two interfaces

   `abogen` is the PyQt6 desktop app with the stable feature set; `abogen-web` is the Flask web UI carrying the newer features.

```bash
abogen
# or
abogen-web
```

4. Convert a book

   Drag an ePub or PDF onto the input box, then set speech speed, pick a voice (the code's first letter is the language — `a` for American English, `b` for British — and the second is `m` or `f`), choose a subtitle style and output format, select where to save, and hit Start. For a book, decide up front whether you want one file per chapter, a merged file, or M4B with chapter markers.

5. Silicon Mac note

   On Apple Silicon the README installs Kokoro's development build alongside abogen for MPS support.

```bash
uv tool install --python 3.13 abogen \
  --with "kokoro @ git+https://github.com/hexgrad/kokoro.git,numpy<2"
```

## When to use it

- Convert an ePub or PDF you own into an M4B audiobook with chapter markers, entirely offline
- Generate voiceover plus word-level captions for short-form video without paying per character to a hosted TTS API
- Batch-narrate a folder of documents through queue mode, with different voices and settings per file
- Build a custom narrator voice in the voice mixer and reuse the saved profile across a whole series
