EPUB to Audiobook Converter Project Overview
The EPUB to Audiobook Converter is a fascinating command-line tool designed to transform EPUB-format ebooks into immersive audiobooks. This unique project leverages advanced text-to-speech (TTS) technologies provided by both Microsoft Azure and OpenAI, allowing users to convert their favorite ebooks into audio format seamlessly. The Audiobookshelf platform is supported for optimal listening experiences.
Features and Capabilities
The project offers a comprehensive solution for audiobook creation:
-
Text-to-Speech Technology: The tool supports multiple TTS providers, including Microsoft Azure TTS, OpenAI TTS, and Edge TTS. Each chapter of an EPUB book is converted into audio, resulting in high-quality sound files.
-
Audio Samples: To evaluate the audio quality, users can listen to samples generated by Azure TTS, OpenAI TTS, and Piper TTS.
-
Integration with Audiobookshelf: The generated audiobooks are tailored for use with Audiobookshelf, making it easy to navigate chapters via displayed titles.
Getting Started
System Requirements
To run the tool effectively, ensure you have either Python 3.6+ installed or Docker. An active Azure account with speech services or an OpenAI API key is also necessary for specific TTS options.
Installation Steps
-
Clone the Repository:
Begin by downloading the tool from GitHub.git clone https://github.com/p0n1/epub_to_audiobook.git cd epub_to_audiobook
-
Set Up a Virtual Environment:
Create and activate a Python virtual environment.python3 -m venv venv source venv/bin/activate
-
Install Dependencies:
Install required software packages.pip install -r requirements.txt
-
Configure Environment Variables:
Set up environment variables for the desired TTS provider. For Azure, input your subscription details; for OpenAI, enter your API key.
Using the Converter
To transform an EPUB file into an audiobook, utilize the following command structure, selecting your preferred TTS provider:
python3 main.py <input_file> <output_folder> --tts <azure/openai/edge/piper>
The tool supports a variety of options to customize the conversion process, including logging, language detection, and chapter selection.
Docker Usage
For those familiar with Docker, a pre-built image of the conversion tool can be pulled from GitHub's Container Registry, simplifying the process by encapsulating necessary dependencies.
docker pull ghcr.io/p0n1/epub_to_audiobook:latest
docker run -i -t --rm -v ./:/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 --tts azure
Customizing the Output
The tool is highly customizable, allowing adjustments for:
- Sound Properties: Fine-tune voice parameters such as pitch, volume, and rate.
- Output Format: Specify audio file formats according to your preferences.
- Voice and Language: Choose different voices and languages supported by the TTS services.
Support and Community
The project team offers support via a dedicated Discord server where users can discuss the tool, share experiences, and get help with any issues they encounter.
Conclusion
The EPUB to Audiobook Converter is an innovative and user-friendly tool designed for readers who wish to transform their digital reading materials into engaging audio experiences. With robust support for various TTS technologies and seamless integration with popular audiobook platforms, this tool stands out as a versatile resource for the avid reader.