From 11384921323f7b08271be0607d8df774489a1f7d Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 19 Aug 2026 02:10:13 -0400 Subject: fix: reduce chunk size to 40 --- converter/config.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'converter/config.py') diff --git a/converter/config.py b/converter/config.py index efec0dd..dcec145 100644 --- a/converter/config.py +++ b/converter/config.py @@ -123,8 +123,9 @@ FASTER_TTS_API_URL = "http://127.0.0.1:8000" # name is unknown, so a mismatch here is easy to miss. FASTER_TTS_VOICE = "default" FASTER_TTS_SAMPLE_RATE = 24000 # Qwen3-TTS 12Hz codec output rate -# The Gradio demo sub-chunked text server-side (~200 chars); the faster server -# takes one generation per request, so long chunks are sub-chunked client-side. +# Safety net: the faster server takes one generation per request, so any +# chunk longer than this is sub-chunked client-side (a no-op at the default +# CHUNK_SIZE_WORDS above; kept in case the chunk size is ever raised). FASTER_SUBCHUNK_WORDS = 40 # ~200 chars per request FASTER_HTTP_TIMEOUT = 300 # Seconds before a speech request times out FASTER_SUBCHUNK_RETRIES = 3 # Attempts per sub-chunk request @@ -138,8 +139,14 @@ AUDIOBOOKS_FOLDER = BASE_DIR / "output" # Output folder CHUNKS_FOLDER = BASE_DIR / "chunks" # Scratch space for per-chunk audio (cleaned per book) LOGS_FOLDER = BASE_DIR / "logs" -CHUNK_SIZE_WORDS = 1500 # Words per TTS chunk -MIN_DELAY_BETWEEN_CHUNKS = 1 # Seconds between API calls +# Words per TTS generation request. Each API call is ONE model generation: +# long generations lose prosody, can degrade into garbled audio, and text +# past the model's token limit is never spoken. ~40 words (~200 chars) is +# the per-request length the old qwen-tts demo enforced server-side. +CHUNK_SIZE_WORDS = 40 +# Pause between API calls (rate-limit protection for hosted demos; a local +# server needs no delay). +MIN_DELAY_BETWEEN_CHUNKS = 0 HEARTBEAT_INTERVAL_SECONDS = 30 # Print "still working" this often during a chunk # ============================================================================= -- cgit v1.2.3