This script allows you to read EPUB books with text-to-speech (TTS) support and an interactive chat mode. You can navigate through sentences, replay text, and ask questions about the current sentence. Everything runs on your machine for free.
- Extracts text from EPUB files
- Uses TTS for sentence-by-sentence playback
- Allows navigation with keyboard shortcuts:
- Right Arrow: Next sentence
- Left Arrow (single click): Repeat current sentence
- Left Arrow (double click): Previous sentence
- Space: Enter chat mode for current sentence
- ESC: Exit program
- Chat mode using Llama3.1 for context-aware discussions
Ensure you have Python installed (>=3.8). Then, install dependencies:
pip install -r requirements.txt- The script will automatically download the
punkttokenizer if not already installed. - The TTS model will be loaded on first use.
- Ollama has to be installed and running (it's free, see https://ollama.com/)
Run the script and provide an EPUB file path when prompted:
python epub_reader.pyFollow the on-screen instructions to navigate and interact with the book.