diff options
| author | historia <historiavg@proton.me> | 2026-09-09 23:25:52 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-09 23:25:52 -0400 |
| commit | 31459b281b6a5368c692b3c42c91e522995ebd57 (patch) | |
| tree | ea6a53f4252e6a08d954c4b2fc9369d8db376d0a /app/converter/config.py | |
| parent | 130dcd988e0554a6343c92fd45d808fd508789b3 (diff) | |
| download | tts-audiobook-generator-31459b281b6a5368c692b3c42c91e522995ebd57.tar.gz | |
feat: smart chunking to avoid chunk boundaries mid-sentence
Diffstat (limited to 'app/converter/config.py')
| -rw-r--r-- | app/converter/config.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/converter/config.py b/app/converter/config.py index da73427..c021375 100644 --- a/app/converter/config.py +++ b/app/converter/config.py @@ -10,6 +10,13 @@ HEARTBEAT_INTERVAL_SECONDS = 30 # Print "still working" in console logs every N # Words per TTS generation request (client-side chunking). CHUNK_SIZE = 250 +# Chunking strategy. Smart chunking ends each request at the end of a +# sentence or quotation instead of a mid-sentence overflow: chunks stay +# at or below CHUNK_SIZE (most land slightly under it, aiming for a +# natural boundary near 85%) and short quotations are kept in one +# request when they fit. Turn it off for the exact legacy splitting. +SMART_CHUNKING = True + # Where books are read from and where finished audiobooks are written. # Relative paths resolve against the project root. INPUT_DIR = "input" |
