Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: blue
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
@@ -11,4 +11,152 @@ license: mit
|
|
11 |
short_description: Convert ebook to audiobook with espeak
|
12 |
---
|
13 |
|
14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Ebook2audiobookEspeak
|
3 |
+
emoji: β‘π
|
4 |
colorFrom: blue
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
|
|
11 |
short_description: Convert ebook to audiobook with espeak
|
12 |
---
|
13 |
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
15 |
+
|
16 |
+
|
17 |
+
# π eBook to Audiobook Converter with eSpeak-ng
|
18 |
+
|
19 |
+
Convert eBooks to audiobooks with chapters and metadata using Calibre and eSpeak-ng. Supports multiple languages and customizable voice settings!
|
20 |
+
|
21 |
+
## π Features
|
22 |
+
|
23 |
+
- π Converts eBooks to text format using Calibre.
|
24 |
+
- π Splits eBooks into chapters for organized audio.
|
25 |
+
- ποΈ High-quality text-to-speech using eSpeak-ng.
|
26 |
+
- π Supports multiple languages and accents.
|
27 |
+
- ποΈ Customizable voice, speed, and pitch settings.
|
28 |
+
- π₯οΈ User-friendly Gradio web interface.
|
29 |
+
- β‘ Designed to run lighting fast on only 100 MB ram.
|
30 |
+
|
31 |
+
## π οΈ Requirements
|
32 |
+
|
33 |
+
- Python 3.x
|
34 |
+
- `gradio` Python package
|
35 |
+
- Calibre (for eBook conversion)
|
36 |
+
- FFmpeg (for audiobook creation)
|
37 |
+
- eSpeak-ng (for text-to-speech)
|
38 |
+
|
39 |
+
## π₯οΈ Gradio Web Gui
|
40 |
+
<img width="1405" alt="Screenshot 2024-08-17 at 4 42 16β―PM" src="https://github.com/user-attachments/assets/ee8f29be-b696-4d66-81de-00c85f1f5c66">
|
41 |
+
|
42 |
+
<img width="1407" alt="Screenshot 2024-08-17 at 4 42 22β―PM" src="https://github.com/user-attachments/assets/7a060762-d4fc-41cc-96b2-071f33e50f0c">
|
43 |
+
|
44 |
+
|
45 |
+
### π§ Installation Instructions
|
46 |
+
|
47 |
+
1. **Install Python 3.x** from [Python.org](https://www.python.org/downloads/).
|
48 |
+
|
49 |
+
2. **Install Calibre**:
|
50 |
+
- **Ubuntu**: `sudo apt-get install -y calibre`
|
51 |
+
- **macOS**: `brew install calibre`
|
52 |
+
- **Windows** (Admin Powershell): `choco install calibre`
|
53 |
+
|
54 |
+
3. **Install FFmpeg**:
|
55 |
+
- **Ubuntu**: `sudo apt-get install -y ffmpeg`
|
56 |
+
- **macOS**: `brew install ffmpeg`
|
57 |
+
- **Windows** (Admin Powershell): `choco install ffmpeg`
|
58 |
+
|
59 |
+
4. **Install eSpeak-ng**:
|
60 |
+
- **Ubuntu**: `sudo apt-get install -y espeak-ng`
|
61 |
+
- **macOS**: `brew install espeak-ng`
|
62 |
+
- **Windows** (Admin Powershell): `choco install espeak-ng`
|
63 |
+
|
64 |
+
5. **Install Python packages**:
|
65 |
+
```bash
|
66 |
+
pip install gradio bs4 pydub nltk beautifulsoup4 ebooklib tqdm
|
67 |
+
```
|
68 |
+
|
69 |
+
**For non-Latin languages**:
|
70 |
+
```bash
|
71 |
+
python -m nltk.downloader punkt
|
72 |
+
```
|
73 |
+
|
74 |
+
## π Supported Languages and Voices
|
75 |
+
|
76 |
+
eSpeak-ng provides a variety of voices for different languages and accents:
|
77 |
+
|
78 |
+
- **Afrikaans**: `af`
|
79 |
+
- **Amharic**: `am`
|
80 |
+
- **Arabic**: `ar`
|
81 |
+
- **Bengali**: `bn`
|
82 |
+
- **Bosnian**: `bs`
|
83 |
+
- **Catalan**: `ca`
|
84 |
+
- **Chinese (Mandarin)**: `cmn`
|
85 |
+
- **Croatian**: `hr`
|
86 |
+
- **Czech**: `cs`
|
87 |
+
- **Danish**: `da`
|
88 |
+
- **Dutch**: `nl`
|
89 |
+
- **English (Great Britain)**: `en-gb`
|
90 |
+
- **English (America)**: `en-us`
|
91 |
+
- **Esperanto**: `eo`
|
92 |
+
- **Finnish**: `fi`
|
93 |
+
- **French**: `fr`
|
94 |
+
- **German**: `de`
|
95 |
+
- **Greek**: `el`
|
96 |
+
- **Hindi**: `hi`
|
97 |
+
- **Hungarian**: `hu`
|
98 |
+
- **Icelandic**: `is`
|
99 |
+
- **Italian**: `it`
|
100 |
+
- **Japanese**: `ja`
|
101 |
+
- **Korean**: `ko`
|
102 |
+
- **Latvian**: `lv`
|
103 |
+
- **Macedonian**: `mk`
|
104 |
+
- **Norwegian (BokmΓ₯l)**: `nb`
|
105 |
+
- **Polish**: `pl`
|
106 |
+
- **Portuguese (Brazil)**: `pt-br`
|
107 |
+
- **Portuguese (Portugal)**: `pt`
|
108 |
+
- **Russian**: `ru`
|
109 |
+
- **Spanish (Spain)**: `es`
|
110 |
+
- **Swedish**: `sv`
|
111 |
+
- **Turkish**: `tr`
|
112 |
+
- **Vietnamese**: `vi`
|
113 |
+
- **Welsh**: `cy`
|
114 |
+
|
115 |
+
## π Usage
|
116 |
+
|
117 |
+
### π₯οΈ Gradio Web Interface
|
118 |
+
|
119 |
+
1. **Run the Script**:
|
120 |
+
```bash
|
121 |
+
python gradio_launch.py
|
122 |
+
```
|
123 |
+
|
124 |
+
2. **Open the Web App**: Click the URL provided in the terminal to access the web app and convert eBooks.
|
125 |
+
|
126 |
+
## π³ Using Docker
|
127 |
+
|
128 |
+
You can also use Docker to run the eBook to Audiobook converter. This method ensures consistency across different environments and simplifies setup.
|
129 |
+
|
130 |
+
### π Running the Docker Container
|
131 |
+
|
132 |
+
To run the Docker container and start the Gradio interface, use the following command:
|
133 |
+
|
134 |
+
```bash
|
135 |
+
docker run -it --rm -p 7860:7860 athomasson2/ebook2audiobookespeak:latest
|
136 |
+
```
|
137 |
+
|
138 |
+
This command will start the Gradio interface on port 7860. (localhost:7860)
|
139 |
+
|
140 |
+
For more details, visit the [Docker Hub Page](https://hub.docker.com/repository/docker/athomasson2/ebook2audiobookespeak/general).
|
141 |
+
|
142 |
+
## π Supported eBook Formats
|
143 |
+
|
144 |
+
- `.epub`, `.pdf`, `.mobi`, `.txt`, `.html`, `.rtf`, `.chm`, `.lit`, `.pdb`, `.fb2`, `.odt`, `.cbr`, `.cbz`, `.prc`, `.lrf`, `.pml`, `.snb`, `.cbc`, `.rb`, `.tcr`
|
145 |
+
- **Best results**: `.epub` or `.mobi` for automatic chapter detection
|
146 |
+
|
147 |
+
## π Output
|
148 |
+
|
149 |
+
- Creates an `.m4b` file with metadata and chapters.
|
150 |
+
|
151 |
+
## π₯ Demo
|
152 |
+
https://github.com/user-attachments/assets/4decbfc3-b934-498a-935e-180336ecadc4
|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
## π Special Thanks
|
157 |
+
|
158 |
+
- **eSpeak-ng**: [eSpeak-ng GitHub](https://github.com/espeak-ng/espeak-ng)
|
159 |
+
- **Calibre**: [Calibre Website](https://calibre-ebook.com)
|
160 |
+
- **Inspiration from Smiling friends Spamtopia episode Season 2 Episode 7**
|
161 |
+

|
162 |
+
|