epub_to_audiobook  by p0n1

CLI tool to convert EPUBs to audiobooks

created 2 years ago
1,663 stars

Top 26.0% on sourcepulse

GitHubView on GitHub
Project Summary

This project converts EPUB ebooks into audiobooks, targeting users who want to listen to their digital books. It leverages various Text-to-Speech (TTS) engines, including Azure, OpenAI, Edge, and Piper, to generate chapter-by-chapter audio files optimized for platforms like Audiobookshelf.

How It Works

The tool parses EPUB files to extract chapter content and titles, then sends this text to a chosen TTS engine for audio generation. It supports multiple TTS providers, allowing users to select based on cost, quality, or availability. Chapter titles are extracted using HTML tag parsing or fallback methods, ensuring proper metadata for audiobook players.

Quick Start & Requirements

  • Installation: Clone the repository, create a virtual environment, and install dependencies via pip install -r requirements.txt.
  • Prerequisites: Python 3.6+ or Docker. API keys are required for Azure TTS (MS_TTS_KEY, MS_TTS_REGION) and OpenAI TTS (OPENAI_API_KEY). Piper TTS requires its executable and models.
  • Usage: python3 main.py <input_file> <output_folder> [--tts <provider>]
  • Docker: docker pull ghcr.io/p0n1/epub_to_audiobook:latest and run with volume mounts and environment variables for API keys.
  • Docs: https://github.com/p0n1/epub_to_audiobook

Highlighted Details

  • Supports Azure, OpenAI, Edge, and Piper TTS engines.
  • Generates audio files optimized for Audiobookshelf with chapter metadata.
  • Includes a preview mode to estimate costs and chapter details before conversion.
  • Offers search and replace functionality for text correction and pronunciation.
  • Provides Docker images for easier deployment.

Maintenance & Community

  • Active development, with contributions noted.
  • Discord server available for support and discussions.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

Chapter title extraction may not be perfect for all EPUB formats. Some TTS providers require API keys and may incur costs. Piper TTS installation can have platform-specific challenges.

Health Check
Last commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
2
Star History
168 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.