A local Text-to-speech AI audiobook generator, converting EPUB files into audiobooks. Designed to work with a companion iOS app, but can be used to generate standard audio files as well.
BenReader is a Java app and Python CLI that uses the Kokoro-82m TTS model.
Ben Liebkemann - ben@liebkemann.com
Project Link: https://github.com/BounceU/BenReader
https://github.com/BounceU/BenReader/releases
-
Clone the repo
git clone https://github.com/BounceU/BenReader
-
Build the maven project (in JavaSide/benreader/):
mvn clean compile assembly:single
-
Set up your conda environment (in PythonSide/):
conda env create -f environment.yaml conda activate book_ai python -m spacy download en_core_web_sm
-
Build the python project using pyinstaller (in PythonSide/):
pyinstaller --onedir tts_epub.py --add-data "YOUR_MINICONDA_INSTALLATION/envs/book_ai/Lib/site-packages;." --noconfirm -
Setup file structure
BenReader/ ├─ benreader.jar ├─ icons/ │ ├─ add_book.png │ ├─ app_icon.ico │ ├─ app_icon.icns │ ├─ app_icon.png │ ├─ clean.png │ ├─ default_cover.png │ ├─ export_book.png │ ├─ generate_audio.png │ ├─ remove_book.png │ ├─ settings.png ├─ res/ ├─ tts/ │ ├─ bin/ │ │ ├─ ffmpeg.exe │ ├─ tts_epub (executable)
The jar is the one you compiled in step 2, and the contents of the
ttsfolder are the contents of thedist/tts_epub/folder you compiled in step 4. With this, the program is done and you just need to run the jar. Internal program files will appear when you start using the program, like aconfig.jsonfile. You will need to download the FFMPEG distributible for your operating system and insert it into the tts/bin folder as shown above. -
(Optional) Build as application with jpackage
In the
BenReaderdirectory you created, run the following to create an installer- Windows:
jpackage --input "." --name "BenReader" --main-jar "benreader.jar" --icon "icons/app_icon.ico" --win-per-user-install --type msi --win-shortcut --win-menu
- MacOOS:
jpackage -t "dmg" --app-version 1.0 --icon icons/app_icon.icns --name BenReader --verbose --input . --main-jar benreader.jar --mac-sign
- Windows:
- Filter out invisible tags like <span> outside of <p> blocks
- Incorporate other TTS models
- Compile a version of the iOS app that has the Kokoro model built-in
- Add support for importing other filetypes (would convert them to epub in the background)
Distributed under the MIT License. See LICENSE for more information.