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 PC
orComputer
from 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_KEY
and 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_REGION
and 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 PATH
during 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 Prompt
as 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 Prompt
as 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!
Thank you for this. I probably would have figured it out on my own, but I truly appreciate the thorough documentation.
Knowing is half the battle.