From f00249db9d1ea051d29aa1bcca869fc4b88e83eb Mon Sep 17 00:00:00 2001 From: historia Date: Mon, 24 Aug 2026 02:59:26 -0400 Subject: refactor: add app directory, dir structure change --- app/converter/config.py | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 app/converter/config.py (limited to 'app/converter/config.py') diff --git a/app/converter/config.py b/app/converter/config.py new file mode 100644 index 0000000..6a98136 --- /dev/null +++ b/app/converter/config.py @@ -0,0 +1,77 @@ +# Default output options +AUDIO_FORMAT = "m4b" +AUDIO_BITRATE = "128k" +LANGUAGE = "English" + +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). +# The qwen and faster backends always chunk with this size +# The audio.cpp backend chunks long text itself, so this is ignored +# by default with that backend. Force chunking with --chunk +CHUNK_SIZE = 250 + +# Default TTS backend. +# audiocpp: audiocpp_server +# qwen: qwen-tts-demo +# faster: faster-qwen-tts +# The --backend CLI flag overrides this +BACKEND = "audiocpp" + +############################################################################### +# BACKEND 1: qwen-tts-demo (qwen) options # +############################################################################### + +# There are different API URLs for CustomVoice and Base models so you can run both at once +QWEN_API_URL = "http://127.0.0.1:7860" # CustomVoice model +CLONE_API_URL = "http://127.0.0.1:7861" # Base model + +# Custom voice options +SPEAKER = "Vivian" #Vivian, Serena, Uncle_Fu, Dylan, Eric, Ryan, Aiden, Ono_Anna, Sohee +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 + +# 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 +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) + +# Default voice if no --voice is passed +FASTER_VOICE = "default" + +############################################################################### +# BACKEND 3: audio.cpp options # +############################################################################### +AUDIOCPP_API_URL = "http://127.0.0.1:8080" # audio.cpp audiocpp_server + +# Model ids in the audio.cpp server.json config. AUDIOCPP_MODEL_ID may point +# at any TTS model entry the server hosts (qwen3_tts, higgs_audio_tts, +# voxcpm2, index_tts2, ...); 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. 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. A multi-model server (one server.json hosting several +# lazily-loaded entries) does not need editing here: 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 = "qwen" +AUDIOCPP_CLONE_MODEL_ID = "qwen" + +# 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 = "" -- cgit v1.2.3