diff options
Diffstat (limited to 'app/converter/config.py')
| -rw-r--r-- | app/converter/config.py | 104 |
1 files changed, 14 insertions, 90 deletions
diff --git a/app/converter/config.py b/app/converter/config.py index e37269b..3511033 100644 --- a/app/converter/config.py +++ b/app/converter/config.py @@ -3,119 +3,43 @@ AUDIO_FORMAT = "m4b" AUDIO_BITRATE = "128k" LANGUAGE = "English" -API_TIMEOUT = 600 # Timeout per chunk request in seconds -MAX_RETRIES = 3 # Attempts per chunk request +API_TIMEOUT = 600 # Timeout per chunk request in seconds +MAX_RETRIES = 3 # Attempts per chunk request HEARTBEAT_INTERVAL_SECONDS = 30 # Print "still working" in console logs every N seconds # Words per TTS generation request (client-side chunking). CHUNK_SIZE = 250 # Where books are read from and where finished audiobooks are written. -# Relative paths resolve against the project root (the folder containing -# audiobook.py). The --input/--output CLI flags override these per run. +# Relative paths resolve against the project root. INPUT_DIR = "./input" OUTPUT_DIR = "./output" -# Playback speed factor for the final audiobook (1.0 = normal). -# Pitch-preserving. The --speed CLI flag overrides this per run. +# Output audiobook file at a different tempo. SPEED = 1.0 -# Dump each chunk's raw audio and the exact text sent for it under the -# debug/ folder (organized per book and chapter), and log every TTS -# request and response to the console and log file. The --debug CLI flag -# forces this on for a single run. +# Dump each chunk's raw audio and the text sent for it into debug/ DEBUG = False -# Default for "Stop server and exit" (TUI Settings menu: "Stop server -# and exit"): automatically stop the TTS server and exit the TUI after -# generating audiobooks. +# Default option for stop and exit TTS server after generating with TUI STOP_SERVER_AND_EXIT = True -# Default TTS backend. -# audiocpp: audiocpp_server -# qwen: qwen-tts-demo -# faster: faster-qwen-tts -# The --backend CLI flag overrides this -BACKEND = "audiocpp" +# The IP/port that locally-managed TTS server instances run on +QWEN_API_URL = "http://127.0.0.1:7860" +FASTER_API_URL = "http://127.0.0.1:8000" +AUDIOCPP_API_URL = "http://127.0.0.1:8080" -############################################################################### -# BACKEND 1: qwen-tts-demo (qwen) options # -############################################################################### - -# The qwen backend runs ONE demo server at a time, on this port. Which model -# the server hosts is chosen per run on the Generate Audiobooks screen and -# persisted below (see QWEN_MODEL); switching models restarts the server. -QWEN_API_URL = "http://127.0.0.1:7860" # single qwen-tts-demo server - -# Remote (externally-run) server URL. The hub probes it and offers a -# "[remote]" backend entry when it answers with a known qwen-tts demo (any -# of the three models), so an externally-started server can be used alongside -# a locally-managed one. Leave empty to disable remote probing. The default -# matches the local port so an external server squatting the local port is -# found without any configuration. +# The URI used to discover externally-run instances QWEN_REMOTE_URL = "http://127.0.0.1:7860" - -# Which model the managed demo server runs (one server hosts one model): -# CustomVoice - built-in speakers (see SPEAKER) -# Base - voice cloning from a reference .wav -# VoiceDesign - voice described by an instruction -# Chosen per run in the Generate-audiobooks form; edited here only as the -# default for the next run. -QWEN_MODEL = "CustomVoice" - -# Custom voice options -SPEAKER = "Vivian" #Vivian, Serena, Uncle_Fu, Dylan, Eric, Ryan, Aiden, Ono_Anna, Sohee -# Style/delivery instruction for CustomVoice runs; also the default design -# instruction when a VoiceDesign run does not override it. -INSTRUCT = "Speak naturally and clearly, as if reading a dramatic book to an adult audience." - -# Don't clone with transcription, only use x-vector-only cloning. Generally "worse" -XVECTOR_ONLY = False +FASTER_REMOTE_URL = "http://127.0.0.1:8000" +AUDIOCPP_REMOTE_URL = "http://127.0.0.1:8080" # Randomization seed. -1 means randomize with every generation # With SEED = -1 and CONSTANT_SEED = True, one random seed will be used for the entire audiobook. -# This may keep the voice slightly more consistent across chunk boundaries +# This MAY keep the voice slightly more consistent across chunk boundaries SEED = -1 CONSTANT_SEED = False -############################################################################### -# BACKEND 2: faster-qwen-tts options # -############################################################################### -FASTER_API_URL = "http://127.0.0.1:8000" # faster-qwen3-tts server (Base model only) -FASTER_REMOTE_URL = "http://127.0.0.1:8000" # externally-run faster-qwen3-tts server ("" disables probing) - -# Default voice if no --voice is passed -FASTER_VOICE = "narrator" - -############################################################################### -# BACKEND 3: audio.cpp options # -############################################################################### -AUDIOCPP_API_URL = "http://127.0.0.1:8082" # audio.cpp audiocpp_server -AUDIOCPP_REMOTE_URL = "http://127.0.0.1:8080" # externally-run audiocpp_server ("" disables probing) - -# Model ids in the audio.cpp server.json config. AUDIOCPP_MODEL_ID may point -# at any TTS model entry the server hosts; the family is detected from the -# server at startup and adapts the request automatically. Only qwen3_tts has -# built-in speakers (speaker mode); every other family needs --voice with a -# server-side voice preset. The server entry id is the model package's -# target_directory name (e.g. "Qwen3-TTS-12Hz-1.7B-Base-GGUF"). For -# single-model servers, set AUDIOCPP_CLONE_MODEL_ID to the same id as -# AUDIOCPP_MODEL_ID (or leave it empty); for Qwen3-TTS it typically names a -# second entry with the Base (cloning) model. Both default to empty so a -# single-entry server is auto-selected; a multi-model server (one server.json -# hosting several lazily-loaded entries) needs no editing here either: leave -# AUDIOCPP_MODEL_ID unset to auto-select when only one entry is hosted, or -# pick the entry per run with the --model CLI flag. -AUDIOCPP_MODEL_ID = "Qwen3-TTS-12Hz-1.7B-Base-GGUF" -AUDIOCPP_CLONE_MODEL_ID = "Qwen3-TTS-12Hz-1.7B-Base-GGUF" - -# Voice design / style instruction sent with every audio.cpp request when -# the --instructions CLI flag is not given. Required for server entries -# hosted with task "vdes" (voice design models such as Qwen3-TTS -# VoiceDesign); on other families it acts as a style/delivery instruction -# when the model supports one and is ignored otherwise. Empty by default. -AUDIOCPP_INSTRUCTIONS = "" - # Ask the audio.cpp server to unload all currently loaded models before # converting, so models left resident by earlier runs free their memory # (e.g. VRAM on GPU backends) and only the selected entry loads. Set to |
