Cadence is an immersive reading pipeline: book file -> chapter text -> audiobook audio -> word-level synced reader data.
- Imports EPUB/MOBI/AZW3 files (MOBI/AZW3 are converted to EPUB via Calibre) and extracts ordered chapter text.
- Synthesizes chapter audio with Supertonic TTS.
- Aligns audio to text with WhisperX for word timestamps.
- Plays back in a synced reader/player UI.
- Uses a streaming chapter pipeline so reading can start before full import finishes.
- Source normalization: MOBI/AZW3 -> EPUB (Calibre, when needed)
- EPUB extraction (Calibre) ->
library/<book>/content/ch_XXX.txt - Per chapter: TTS synthesis (Supertonic) ->
library/<book>/audio/ch_XXX.wav - Per chapter: Alignment (WhisperX) ->
library/<book>/content/ch_XXX.json - Player can read chapters as soon as each chapter has audio + alignment.
- Cadence now runs chapter-by-chapter interleaved processing:
- If a chapter already has
.wav, Cadence skips synthesis and aligns it. - If
.wavis missing, Cadence synthesizes first, then aligns. - If
.wavand.jsonboth exist, Cadence skips that chapter.
- If a chapter already has
- This makes resume robust after interruptions and enables immediate reading while import is still running.
- Library cards update live with ready counts (
Audio x/y,Alignment x/y) during import.
Cadence processes books one chapter at a time, not as one long batch.
- As soon as a chapter finishes synthesis + alignment, it is immediately readable.
- You can open the reader and start from available chapters while the rest of the book continues importing.
- If import is interrupted, re-import resumes from existing chapter outputs instead of starting over.
- Windows 10/11
- Python 3.12
- Calibre (
ebook-convert.exe) installed at:C:\Program Files\Calibre2\ebook-convert.exe
- FFmpeg (
ffmpeg.exe) available inPATH(required for Qt player speed control) - NVIDIA GPU recommended for faster TTS/ASR
python -m venv venv
.\venv\Scripts\Activate.ps1
python -m pip install --upgrade pipInstall one runtime profile (fresh venv recommended):
GPU profile (default):
pip install -r requirements-gpu.txtCPU profile:
pip install -r requirements-cpu.txtBackward-compatible default (requirements.txt) points to GPU profile.
Do not install both CPU and GPU ONNX Runtime packages in the same environment.
If you use a separate WhisperX venv, point Cadence to it:
$env:CADENCE_WHISPERX_PYTHON="C:\Users\mateo\Desktop\Cadence\venv_whisperx\Scripts\python.exe".\venv\Scripts\Activate.ps1
python main.pyCadence uses cadence_settings.json (managed from the UI settings cog next to Import Book).
- Settings are persisted automatically when you click Apply.
- Settings are applied immediately to the current app process.
CADENCE_*environment variables are still usable for one-off CLI/script runs.
Useful keys:
CADENCE_EXTRACT_WORKERSCADENCE_SYNTH_WORKERSCADENCE_TTS_MAX_CHARSCADENCE_FORCE_CPUCADENCE_CUDA_ONLYCADENCE_WHISPERX_MODELCADENCE_WHISPERX_BATCH_SIZECADENCE_WHISPERX_COMPUTE_TYPECADENCE_WHISPERX_DEVICECADENCE_WHISPERX_PYTHONCADENCE_CALIBRE_PATH


