Sign inSign up

athomasson2/ebook2audiobookespeak

By athomasson2

•Updated over 1 year ago

Generate audiobook from ebook files with espeak

Image
Data science
0

606

athomasson2/ebook2audiobookespeak repository overview

⁠📚 eBook to Audiobook Converter with eSpeak-ng

Convert eBooks to audiobooks effortlessly using a Docker container. This project leverages Calibre for eBook conversion and eSpeak-ng for text-to-speech, all wrapped in a Gradio interface.

⁠🌟 Features

  • eBook Conversion: Converts various eBook formats to text using Calibre.
  • Text-to-Speech: High-quality TTS using eSpeak-ng with customizable voice, speed, and pitch.
  • Language Support: Includes multiple languages and accents for TTS.
  • User-Friendly Interface: Easy-to-use Gradio interface accessible via your web browser.
  • Dockerized: Run the entire setup with a single Docker command.

⁠🎥 Demo

https://github.com/user-attachments/assets/4decbfc3-b934-498a-935e-180336ecadc4⁠

⁠🖥️ Gradio Web Gui

Screenshot 2024-08-17 at 4 42 16 PM Screenshot 2024-08-17 at 4 42 22 PM

⁠🚀 Quick Start

To quickly get started with this eBook to Audiobook converter, simply run the following Docker command:

docker run -it --rm -p 7860:7860 athomasson2/ebook2audiobookespeak:latest

This will start the Gradio interface on port 7860. You can access it by navigating to http://localhost:7860 in your web browser.

⁠🎛️ Gradio Interface Customizations

In the Gradio interface, you can customize the following settings for your audiobook conversion:

  • Speed: Adjust the reading speed from 80 to 450 words per minute (default is 170).
  • Pitch: Modify the pitch of the voice from 0 to 99 (default is 50).
  • Voice Selection: Choose from a variety of voices and accents available in eSpeak-ng.
  • Audiobook Player: Listen to the converted audiobook directly in the interface.
  • Download Audiobook: Download the generated audiobook files directly to your device.

⁠🛠️ Building the Docker Image

If you prefer to build the Docker image yourself, use the following Dockerfile:

# Use an official Python 3.10 image
FROM python:3.10-slim-buster

# Set non-interactive installation to avoid timezone and other prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    calibre \
    espeak \
    espeak-ng \
    ffmpeg \
    wget \
    tk \
    mecab \
    libmecab-dev \
    mecab-ipadic-utf8 \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /ebook2audiobookXTTS

# Clone the repository and install dependencies
RUN git clone https://github.com/DrewThomasson/ebook2audiobookEspeak.git .

# Install Python dependencies
RUN pip install --upgrade pip && \
    pip install bs4 pydub nltk beautifulsoup4 ebooklib tqdm gradio

# Download the punkt package for nltk
RUN python -m nltk.downloader punkt

# Verify the script exists and has correct permissions
RUN ls -la /ebook2audiobookXTTS/ && \
    if [ ! -f /ebook2audiobookXTTS/gradio_launch.py ]; then echo "Script not found."; exit 1; fi

# Set the command to run your application
CMD ["python", "/ebook2audiobookXTTS/gradio_launch.py"]

To build the image, run:

docker build -t athomasson2/ebook2audiobookespeak:latest .

⁠🎉 Enjoy

Explore the full power of this converter by running your Docker container. Customize the settings in the Gradio interface to suit your needs.

For more details and updates, visit the GitHub repository⁠.

⁠🙏 Special Thanks

Tag summary

Content type

Image

Digest

sha256:0853454a9…

Size

671.7 MB

Last updated

over 1 year ago

docker pull athomasson2/ebook2audiobookespeak