Generate audiobooks from EPUBs, PDFs and text with synchronized captions.
Generate audiobooks from EPUBs, PDFs and text with synchronized captions.
Abogen is a powerful text-to-speech conversion tool that makes it easy to turn ePub, PDF, text, markdown, or subtitle files into high-quality audio with matching subtitles in seconds. Use it for audiobooks, voiceovers for Instagram, YouTube, TikTok, or any project that needs natural-sounding text-to-speech, using Kokoro-82M.
https://github.com/user-attachments/assets/094ba3df-7d66-494a-bc31-0e4b41d0b865
This demo was generated in just 5 seconds, producing ∼1 minute of audio with perfectly synced subtitles. To create a similar video, see the demo guide.
How to install? WindowsGo to espeak-ng latest release download and run the *.msi file.
WINDOWS_INSTALL.bat by double-clicking itThis method handles everything automatically - installing all dependencies including CUDA in a self-contained environment without requiring a separate Python installation. (You still need to install espeak-ng.)
[!NOTE] You don't need to install Python separately. The script will install Python automatically.
First, install uv if you haven't already.
…
Alternative: Install using pip (click to expand)# Create a virtual environment (optional)
mkdir abogen && cd abogen
python -m venv venv
venv\Scripts\activate
# For NVIDIA GPUs:
# We need to use an older version of PyTorch (2.8.0) until this issue is fixed: https://github.com/pytorch/pytorch/issues/166628
pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu128
# For AMD GPUs:
# Not supported yet, because ROCm is not available on Windows. Use Linux if you have AMD GPU.
# Install abogen
pip install abogen
MacFirst, install uv if you haven't already.
# Install espeak-ng
brew install espeak-ng
# For Silicon Mac (M1, M2 etc.)
uv tool install --python 3.13 abogen --with "kokoro @ git+https://github.com/hexgrad/kokoro.git,numpy<2"
# For Intel Mac
uv tool install --python 3.12 abogen --with "kokoro @ git+https://github.com/hexgrad/kokoro.git,numpy<2"
Alternative: Install using pip (click to expand)# Install espeak-ng
brew install espeak-ng
# Create a virtual environment (recommended)
mkdir abogen && cd abogen
python3 -m venv venv
source venv/bin/activate
# Install abogen
pip3 install abogen
# For Silicon Mac (M1, M2 etc.)
# After installing abogen, we need to install Kokoro's development version which includes MPS support.
pip3 install git+https://github.com/hexgrad/kokoro.git
LinuxFirst, install uv if you haven't already.
# Install espeak-ng
sudo apt install espeak-ng # Ubuntu/Debian
sudo pacman -S espeak-ng # Arch Linux
sudo dnf install espeak-ng # Fedora
# For NVIDIA GPUs or without GPU - No need to include [cuda] in here.
uv tool install --python 3.12 abogen
# For AMD GPUs (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
Alternative: Install using pip (click to expand)…
See How to fix "CUDA GPU is not available. Using CPU" warning?
See How to fix "[WinError 1114] A dynamic link library (DLL) initialization routine failed" error?
Special thanks to @hg000125 for his contribution in #23. AMD GPU support is possible thanks to his work.
Abogen offers two interfaces, but currently they have different feature sets. The Web UI contains newer features that are still being integrated into the desktop application.
| Command | Interface | Features |
|---|---|---|
abogen |
PyQt6 Desktop GUI | Stable core features |
abogen-web |
Flask Web UI | Core features + Supertonic TTS, LLM Normalization, Audiobookshelf Integration and more! |
Note: The Web UI is under active development. We are working to integrate these new features into the PyQt desktop app. until then, the Web UI provides the most feature-rich experience.
Special thanks to @jeremiahsb for making this possible! I was honestly surprised by his massive contribution (>55,000 lines!) that brought the entire Web UI to life.
How to run?You can simply run this command to start Abogen Desktop GUI:
abogen
[!TIP] If you installed Abogen using the Windows installer
(WINDOWS_INSTALL.bat), It should have created a shortcut in the same folder, or your desktop. You can run it from there. If you lost the shortcut, Abogen is located inpython_embedded/Scripts/abogen.exe. You can run it from there directly.
How to use?In actionHere’s Abogen in action: in this demo, it processes ∼3,000 characters of text in just 11 seconds and turns it into 3 minutes and 28 seconds of audio, and I have a low-end RTX 2060 Mobile laptop GPU. Your results may vary depending on your hardware.
Configuration| Options | Description |
|---|---|
| Input Box | Drag and drop ePub, PDF, .TXT, .MD, .SRT, .ASS or .VTT files (or use built-in text editor) |
| Queue options | Add multiple files to a queue and process them in batch, with individual settings for each file. See Queue mode for more details. |
| Speed | Adjust speech rate from 0.1x to 2.0x |
| Select Voice | First letter of the language code (e.g., a for American English, b for British English, etc.), second letter is for m for male and f for female. |
| Voice mixer | Create custom voices by mixing different voice models with a profile system. See Voice Mixer for more details. |
| Voice preview | Listen to the selected voice before processing. |
| Generate subtitles | Disabled, Line, Sentence, Sentence + Comma, Sentence + Highlighting, 1 word, 2 words, 3 words, etc. (Represents the number of words in each subtitle entry) |
| Output voice format | .WAV, .FLAC, .MP3, .OPUS (best compression) and M4B (with chapters) |
| Output subtitle format | Configures the subtitle format as SRT (standard), ASS (wide), ASS (narrow), ASS (centered wide), or ASS (centered narrow). |
| Replace single newlines with spaces | Replaces single newlines with spaces in the text. This is useful for texts that have imaginary line breaks. |
| Save location | Save next to input file, Save to desktop, or Choose output folder |
Special thanks to @brianxiadong for adding markdown support in PR #75
Special thanks to @mleg for adding
Lineoption in subtitle generation in PR #94
| Book handler options | Description |
|---|---|
| Chapter Control | Select specific chapters from ePUBs or markdown files or chapters + pages from PDFs. |
| Save each chapter separately | Save each chapter in e-books as a separate audio file. |
| Create a merged version | Create a single audio file that combines all chapters. (If Save each chapter separately is disabled, this option will be the default behavior.) |
| Save in a project folder with metadata | Save the converted items in a project folder with available metadata files. |
| Menu options | Description |
|---|---|
| Theme | Change the application's theme using System, Light, or Dark options. |
| Configure max words per subtitle | Configures the maximum number of words per subtitle entry. |
| Configure silence between chapters | Configures the duration of silence between chapters (in seconds). |
| Configure max lines in log window | Configures the maximum number of lines to display in the log window. |
| Separate chapters audio format | Configures the audio format for separate chapters as wav, flac, mp3, or opus. |
| Create desktop shortcut | Creates a shortcut on your desktop for easy access. |
| Open config directory | Opens the directory where the configuration file is stored. |
| Open cache directory | Opens the cache directory where converted text files are stored. |
| Clear cache files | Deletes cache files created during the conversion or preview. |
| Use silent gaps between subtitles | Prevents unnecessary audio speed-up by letting speech continue into the silent gaps between subtitle etries. In short, it ignores the end times in subtitle entries and uses the silent space until the beginning of the next subtitle entry. When disabled, it speeds up the audio to fit the exact time interval specified in the subtitle. (for subtitle files). |
| Subtitle speed adjustment method | Choose how to speed up audio when needed: TTS Regeneration (better quality) re-generates the audio at a faster speed, while FFmpeg Time-stretch (better speed) quickly speeds up the generated audio. (for subtitle files). |
| Use spaCy for sentence segmentation | When this option is enabled, Abogen uses spaCy to detect sentence boundaries more accurately, instead of using punctuation marks (like periods, question marks, etc.) to split sentences, which could incorrectly cut off phrases like "Mr." or "Dr.". With spaCy, sentences are divided more accurately. For non-English text, spaCy runs before audio generation to create sentence chunks. For English text, spaCy runs during subtitle generation to improve timing and readability. spaCy is only used when subtitle mode is Sentence or Sentence + Comma. If you prefer the old punctuation splitting method, you can turn this option off. |
| Pre-download models and voices for offline use | Opens a window that displays the available models and voices. Click Download all button to download all required models and voices, allowing you to use Abogen completely offline without any internet connection. |
| Disable Kokoro's internet access | Prevents Kokoro from downloading models or voices from HuggingFace Hub, useful for offline use. |
| Check for updates at startup | Automatica |
No open issues yet, or sync has not completed.