Spaces:
Sleeping
A newer version of the Gradio SDK is available:
5.28.0
title: Ebook2audiobookEspeak
emoji: β‘π
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
short_description: Convert ebook to audiobook with espeak
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
π eBook to Audiobook Converter with eSpeak-ng
Convert eBooks to audiobooks with chapters and metadata using Calibre and eSpeak-ng. Supports multiple languages and customizable voice settings!
π Features
- π Converts eBooks to text format using Calibre.
- π Splits eBooks into chapters for organized audio.
- ποΈ High-quality text-to-speech using eSpeak-ng.
- π Supports multiple languages and accents.
- ποΈ Customizable voice, speed, and pitch settings.
- π₯οΈ User-friendly Gradio web interface.
- β‘ Designed to run lighting fast on only 100 MB ram.
π οΈ Requirements
- Python 3.x
gradio
Python package- Calibre (for eBook conversion)
- FFmpeg (for audiobook creation)
- eSpeak-ng (for text-to-speech)
π₯οΈ Gradio Web Gui
π§ Installation Instructions
Install Python 3.x from Python.org.
Install Calibre:
- Ubuntu:
sudo apt-get install -y calibre
- macOS:
brew install calibre
- Windows (Admin Powershell):
choco install calibre
- Ubuntu:
Install FFmpeg:
- Ubuntu:
sudo apt-get install -y ffmpeg
- macOS:
brew install ffmpeg
- Windows (Admin Powershell):
choco install ffmpeg
- Ubuntu:
Install eSpeak-ng:
- Ubuntu:
sudo apt-get install -y espeak-ng
- macOS:
brew install espeak-ng
- Windows (Admin Powershell):
choco install espeak-ng
- Ubuntu:
Install Python packages:
pip install gradio bs4 pydub nltk beautifulsoup4 ebooklib tqdm
For non-Latin languages:
python -m nltk.downloader punkt
π Supported Languages and Voices
eSpeak-ng provides a variety of voices for different languages and accents:
- Afrikaans:
af
- Amharic:
am
- Arabic:
ar
- Bengali:
bn
- Bosnian:
bs
- Catalan:
ca
- Chinese (Mandarin):
cmn
- Croatian:
hr
- Czech:
cs
- Danish:
da
- Dutch:
nl
- English (Great Britain):
en-gb
- English (America):
en-us
- Esperanto:
eo
- Finnish:
fi
- French:
fr
- German:
de
- Greek:
el
- Hindi:
hi
- Hungarian:
hu
- Icelandic:
is
- Italian:
it
- Japanese:
ja
- Korean:
ko
- Latvian:
lv
- Macedonian:
mk
- Norwegian (BokmΓ₯l):
nb
- Polish:
pl
- Portuguese (Brazil):
pt-br
- Portuguese (Portugal):
pt
- Russian:
ru
- Spanish (Spain):
es
- Swedish:
sv
- Turkish:
tr
- Vietnamese:
vi
- Welsh:
cy
π Usage
π₯οΈ Gradio Web Interface
Run the Script:
python gradio_launch.py
Open the Web App: Click the URL provided in the terminal to access the web app and convert eBooks.
π³ Using Docker
You can also use Docker to run the eBook to Audiobook converter. This method ensures consistency across different environments and simplifies setup.
π Running the Docker Container
To run the Docker container and start the Gradio interface, use the following command:
docker run -it --rm -p 7860:7860 athomasson2/ebook2audiobookespeak:latest
This command will start the Gradio interface on port 7860. (localhost:7860)
For more details, visit the Docker Hub Page.
π Supported eBook Formats
.epub
,.pdf
,.mobi
,.txt
,.html
,.rtf
,.chm
,.lit
,.pdb
,.fb2
,.odt
,.cbr
,.cbz
,.prc
,.lrf
,.pml
,.snb
,.cbc
,.rb
,.tcr
- Best results:
.epub
or.mobi
for automatic chapter detection
π Output
- Creates an
.m4b
file with metadata and chapters.
π₯ Demo
https://github.com/user-attachments/assets/4decbfc3-b934-498a-935e-180336ecadc4
π Special Thanks
- eSpeak-ng: eSpeak-ng GitHub
- Calibre: Calibre Website
- Inspiration from Smiling friends Spamtopia episode Season 2 Episode 7