Welcome to the tutorial on using the EPUB to Audiobook Converter tool on Windows. If you're not familiar with command-line tools or programming, don't worry. This guide is specially designed for users like you. Let's get started!
This tutorial may be out of date. So also check the README of https://github.com/p0n1/epub_to_audiobook for latest command options.
- A working internet connection
- An active Microsoft Azure account with access to the Microsoft Cognitive Services Speech Services. If you don't have one, follow this link to create it.
- Download and install Git for Windows
- Right-click on
This PCorComputerfrom your desktop or File Explorer, then click onProperties. - On the left side, click on
Advanced system settings. - Under the Advanced tab, click on
Environment Variables.... - In the User Variables section, click on
New.... - For Variable name, enter
MS_TTS_KEYand for Variable value, enter your Azure Text-to-Speech subscription key. Click OK. - Click on
New...again. - This time, for Variable name, enter
MS_TTS_REGIONand for Variable value, enter your Azure Text-to-Speech region (e.g., "westus"). Click OK.
- Press
Win + R, typecmd, and press Enter. - Type the following commands, replacing
<your_subscription_key>and<your_region>with your respective Azure details:
setx MS_TTS_KEY "<your_subscription_key>" /M
setx MS_TTS_REGION "<your_region>" /M
- Download and install Python. Make sure to check the box
Add Python to PATHduring installation. - Open
Git Bash(search in the start menu). - Clone the repository:
git clone https://github.com/p0n1/epub_to_audiobook.git
cd epub_to_audiobook
- Create a virtual environment and activate it:
python -m venv venv
source venv/Scripts/activate
- Install the required dependencies:
pip install -r requirements.txt
- Download and install Docker for Windows.
- Open
Command Promptas Administrator. - Pull the Docker image:
docker pull ghcr.io/p0n1/epub_to_audiobook:latest
- Open
Git Bash. - Navigate to the project directory:
cd path/to/epub_to_audiobook
Replace path/to/ with the actual path where you cloned the repository.
- Convert the EPUB to Audiobook:
python main.py <input_file> <output_folder> [--voice_name <voice_name>] [--language <language>]
Example:
python main.py examples/The_Life_and_Adventures_of_Robinson_Crusoe.epub output_folder
- Open
Command Promptas Administrator. - Navigate to the directory where your EPUB file is located.
- Run the tool:
docker run -i -t --rm -v %cd%:/app -e MS_TTS_KEY=%MS_TTS_KEY% -e MS_TTS_REGION=%MS_TTS_REGION% ghcr.io/p0n1/epub_to_audiobook your_book.epub audiobook_output
Replace your_book.epub with the name of your EPUB file.
- For detailed options, voice, and language customization, and other information, please refer to the official README.
- If you want to customize voice or language, check the Microsoft Azure Text-to-Speech documentation.
That's it! You've now successfully converted your EPUB into an audiobook. Enjoy listening!




I'm getting an error as below when I try to run in Python
ModuleNotFoundError: No module named 'ebooklib'
This is the full window
python3 epub_to_audiobook.py C:/Users/Brett/Documents/Epub/HarryPotter1.epub C:/Users/Brett/Documents/EpubOutput
Traceback (most recent call last):
File "C:\Users\Brett\epub_to_audiobook\epub_to_audiobook.py", line 102, in
main()
File "C:\Users\Brett\epub_to_audiobook\epub_to_audiobook.py", line 98, in main
AudiobookGenerator(config).run()
File "C:\Users\Brett\epub_to_audiobook\audiobook_generator\core\audiobook_generator.py", line 37, in run
book_parser = get_book_parser(self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Brett\epub_to_audiobook\audiobook_generator\book_parsers\base_book_parser.py", line 41, in get_book_parser
from audiobook_generator.book_parsers.epub_book_parser import EpubBookParser
File "C:\Users\Brett\epub_to_audiobook\audiobook_generator\book_parsers\epub_book_parser.py", line 5, in
import ebooklib
ModuleNotFoundError: No module named 'ebooklib'
(venv)