English | 中文
Convert EPUB e-books into high-quality audiobooks using Azure Text-to-Speech technology.
- 📚 EPUB Support: Compatible with EPUB 2 and EPUB 3 formats
- 🎙️ High-Quality TTS: Uses Azure Cognitive Services Speech for natural voice synthesis
- 🌍 Multi-Language Support: Supports various languages and voices via Azure TTS
- 📱 M4B Output: Generates standard M4B audiobook format with chapter navigation
- 🔧 CLI Interface: Easy-to-use command-line tool with progress tracking
Convert an EPUB file to audiobook:
epub2speech input.epub output.m4b --voice zh-CN-XiaoxiaoNeural --azure-key YOUR_KEY --azure-region YOUR_REGION- Python 3.11 or higher
- FFmpeg (for audio processing)
- Azure Speech Service credentials
# Install Python dependencies
pip install poetry
poetry install
# Install FFmpeg
# macOS: brew install ffmpeg
# Ubuntu/Debian: sudo apt install ffmpeg
# Windows: Download from https://ffmpeg.org/download.html- Create an Azure account at https://azure.microsoft.com
- Create a Speech Service resource in Azure Portal
- Get your subscription key and region from the Azure dashboard
Set your Azure credentials as environment variables:
export AZURE_SPEECH_KEY="your-subscription-key"
export AZURE_SPEECH_REGION="your-region"
epub2speech input.epub output.m4b --voice zh-CN-XiaoxiaoNeural# Limit to first 5 chapters
epub2speech input.epub output.m4b --voice en-US-AriaNeural --max-chapters 5
# Use custom workspace directory
epub2speech input.epub output.m4b --voice zh-CN-YunxiNeural --workspace /tmp/my-workspace
# Quiet mode (no progress output)
epub2speech input.epub output.m4b --voice ja-JP-NanamiNeural --quietFor a complete list, see Azure Neural Voices.
- EPUB Parsing: Extracts text content and metadata from EPUB files
- Chapter Detection: Identifies chapters using EPUB navigation data
- Text Processing: Cleans and segments text for optimal speech synthesis
- Audio Generation: Converts text to speech using Azure TTS
- M4B Creation: Combines audio files with chapter metadata into M4B format
python test.pyRun specific test modules:
python test.py --test test_epub_picker
python test.py --test test_ttsContributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Azure Cognitive Services for text-to-speech technology
- ebooklib for EPUB parsing
- FFmpeg for audio processing
- spaCy for natural language processing
For issues and questions:
- Check existing GitHub issues
- Create a new issue with detailed information
- Include EPUB file samples if relevant (ensure no copyright restrictions)”,“file_path”: