A suite of tools to split Project Gutenberg texts into scenes and read them aloud using MLX-based streaming TTS.
- Book Splitter: Automatically detects chapter/act structure and splits long text files into Markdown scene files.
- Terminal Reader: CLI-based reader with session persistence and keyboard navigation.
- GUI Reader: Tkinter-based application with folder selection, start/stop controls, and custom bookmark saving.
- Streaming TTS: Low-latency audio synthesis using
mlx-community/chatterbox-turbo-fp16.
- Ensure you have Miniforge installed.
- Create and activate the specialized TTS environment:
conda create -n tts python=3.12 conda activate tts
- Install dependencies:
pip install mlx-audio sounddevice numpy pytest
Take a Project Gutenberg text (like dracula.txt) and split it into scenes:
python sample_code/splitter.py sample_book/dracula.txt sample_book/scenesLaunch the graphical interface to browse scenes and listen:
python sample_code/gui_reader.py- Click Select Book Folder and point to
sample_book/scenes. - Click Start to begin reading.
- Use Save Bookmark to persist your exact position in a scene to a file.
For terminal enthusiasts:
python sample_code/book_reader.py sample_book/scenesEnter: Next scenep: Previous scenes: Skip current audioq: Quit and save position
Run the test suite using pytest:
pytest tests/