aedocw / epub2tts-edge

epub2tts-edge uses Microsoft Edge cloud-based TTS to create a full featured audiobook m4b from an epub or text file
GNU General Public License v3.0
77 stars 13 forks source link

epub2tts-edge is a free and open source python app to easily create a full-featured audiobook from an epub or text file using realistic text-to-speech from Microsoft Edge TTS.

πŸš€ Features

πŸ“– Usage

Usage instructions *NOTE:* If you want to specify where NLTK tokenizer will be stored (about 50mb), use an environment variable: `export NLTK_DATA="your/path/to/nltk_data"` ## FIRST - extract epub contents to text and cover image to png: 1. `epub2tts-edge mybook.epub` 2. **edit mybook.txt**, replacing `# Part 1` etc with desired chapter names, and removing front matter like table of contents and anything else you do not want read. **Note:** First two lines can be Title: and Author: to use that in audiobook metadata. ## Read text to audiobook: * `epub2tts-edge mybook.txt --cover mybook.png` * Optional: specify a speaker with `--speaker `. List available voices with `edge-tts --list-voices`, default speaker is `en-US-AndrewNeural` if `--speaker` is not specified. ## All options * `-h, --help` - show this help message and exit * `--speaker SPEAKER` - Speaker to use (example: en-US-EricNeural) * `--cover image.[jpg|png]` - image to use for cover

🐞 Reporting bugs

How to report bugs/issues Thank you in advance for reporting any bugs/issues you encounter! If you are having issues, first please [search existing issues](https://github.com/aedocw/epub2tts-edge/issues) to see if anyone else has run into something similar previously. If you've found something new, please open an issue and be sure to include: 1. The full command you executed 2. The platform (Linux, Windows, OSX, Docker) 3. Your Python version if not using Docker

πŸ—’οΈ Release notes

Release notes * 20240628: Improved how chapter items are ordered (https://github.com/prydom) * 20240627: Added check for NLTK tokenizer, download if not already there * 20240626: Catch multiple !!! and ??? which chokes Edge TTS (https://github.com/erfansamandarian) * 20240609: Added progress bar (https://github.com/The-Ducktor) * 20240502: Added export of cover image * 20240429: Fixed issues with running on linux * 20240428: Improved final audio by using flac for intermediate audio files, sounds much better * 20240412: Initial release

πŸ“¦ Install

Required Python version is 3.11.

NOTE: If you want to specify where NLTK tokenizer will be stored (about 50mb), use an environment variable: export NLTK_DATA="your/path/to/nltk_data"

MAC INSTALLATION This installation requires Python < 3.12 and [Homebrew](https://brew.sh/) (I use homebrew to install espeak, [pyenv](https://stackoverflow.com/questions/36968425/how-can-i-install-multiple-versions-of-python-on-latest-os-x-and-use-them-in-par) and ffmpeg). ``` #install dependencies brew install espeak pyenv ffmpeg #install epub2tts-edge git clone https://github.com/aedocw/epub2tts-edge cd epub2tts-edge pyenv install 3.11 pyenv local 3.11 #OPTIONAL - install this in a virtual environment python -m venv .venv && source .venv/bin/activate pip install . ```
LINUX INSTALLATION These instructions are for Ubuntu 22.04 (20.04 showed some depedency issues), but should work (with appropriate package installer mods) for just about any repo. Ensure you have `ffmpeg` installed before use. ``` #install dependencies sudo apt install espeak-ng ffmpeg #clone the repo git clone https://github.com/aedocw/epub2tts-edge cd epub2tts-edge pip install . ```
WINDOWS INSTALLATION Runnig epub2tts in WSL2 with Ubuntu 22 is the easiest approach, but these steps should work for running directly in windows. (TBD)

Updating

UPDATING YOUR INSTALLATION 1. cd to repo directory 2. `git pull` 3. Activate virtual environment you installed epub2tts in if you installed in a virtual environment 4. `pip install . --upgrade`

Author

πŸ‘€ Christopher Aedo

πŸ‘₯ Contributors

Contributors

🀝 Contributing

Contributions, issues and feature requests are welcome!\ Feel free to check the issues page or discussions page.

Show your support

Give a ⭐️ if this project helped you!