
gittech. site
for different kinds of informations and explorations.
Convert ePUB to Audio Files
Published at
Dec 22, 2024
Main Article
epub-tts
Convert ePUB into audio files.
Code will parse the ePUB into sections (which roughly correlates to book chapters) and 'text-to-speech' each section into its own audio file.
Output will be prefixed with a number to maintain order.
Requirements
- Run on MacOS
- ffmpeg installed and available in $PATH
- Golang
How to use
- Clone this repo
- Replace the file inside
volume/input.epub
with the book you want to convert to audio (keep file name) - Execute the program (note that it will take quite some time, but you should see some output during execution):
go run .
- You should see a new
output
folder with each text and audio file.
TODO
- Parse ePUB from Golang
- Organize code
- Add worker pools for batch conversion and less CPU strain
- Reduce output audio size
- Extract chapter info
- Add more sample ePUBs
- Add automated tests
- Separate output by folder
- Handle multiple input
- Organize the code some more
- Support other languages beyond english
- Display progress
- Break down a big section to be TTS concurrently, and merge after whole section is done
- Add support for Ubuntu TTS
- Add Web UI to Drag and Drop epub files
- ?
Dependencies
- MacOS
say
command - Note: The example book in this repo is taken from Project Guttenber, with Copyright Status as "Public domain in the USA"
License
Check LICENSE file.