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!




Hi @athriren.
For docker on windows, I'm sorry since I also have little knowledge about this. I found others are also discussing about this over here docker/for-win#13693. I guess you could try to rest docker settings, upgrade/downgrade docker versions, reboot or reinstall. You cannot find the image in Docker Desktop because it's hosted on ghcr.io not docker hub.
For Python on windows, remember you need to run
source venv/Scripts/activateinpath/to/epub_to_audiobookeach time after you reopen the command prompt or Git Bash to make sure correct python environment is loaded. After activating the virtual environment, ensure that the Python interpreter you're using is the one from the virtual environment. Runwhere pythonto see the path of the Python interpreter that is being used. You could also usepip listto check the packages installed. Besides, I think you could try replacepython3withpythonin your command.Feel free to leave a message if you still encounter any issues.