"""Configuration for the audiobook converter. Edit these values to change voices and processing behavior. Everything else (voice mode names, languages, speaker names, model ids, folders, file formats) is fixed in the code where it is used. """ # Server endpoints. Voice clone needs the Base-model demo, which is a # separate server from the CustomVoice demo (that one only exposes # /run_instruct); the faster backend is the OpenAI-compatible server from # the faster-qwen3-tts repository. QWEN_API_URL = "http://127.0.0.1:7860" # CustomVoice demo CLONE_API_URL = "http://127.0.0.1:7861" # Base-model demo FASTER_API_URL = "http://127.0.0.1:8000" # faster-qwen3-tts server # Words per TTS generation request. Each request is ONE model generation: # the voice is re-sampled per request (every chunk boundary can drift # slightly), while over-long generations lose prosody and can turn garbled. # ~250 words is ~1.5-2 minutes of speech: few voice boundaries while # staying inside both servers' generation caps. CHUNK_SIZE = 250 API_TIMEOUT = 600 # Seconds before an API call times out (a ~250-word request can take minutes on the Gradio demo) MAX_RETRIES = 3 # Attempts per chunk request HEARTBEAT_INTERVAL_SECONDS = 30 # Print "still working" this often during a chunk LANGUAGE = "English" # Seed sent to the TTS servers (only the endpoints that accept one; the # primary /run_instruct and /run_voice_clone endpoints and the faster # backend never receive a seed). -1 means "randomize per generation". # With CONSTANT_SEED = True and SEED = -1, one random seed is drawn at # startup and reused for every request of the run, keeping the voice # consistent across chunk boundaries; set SEED to a fixed number to also # reproduce the same voice across runs. SEED = -1 CONSTANT_SEED = True SPEAKER = "Vivian" INSTRUCT = "Speak naturally and clearly, as if reading a dramatic book to an adult audience." XVECTOR_ONLY = False # Must match a key in the faster server's voices.json ("default" when the # server was launched with --ref-audio). The server silently falls back to # its first voice for unknown names. FASTER_VOICE = "default" AUDIO_FORMAT = "m4b" # Default output container AUDIO_BITRATE = "128k"