aboutsummaryrefslogtreecommitdiff
path: root/app/converter/config.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-24 02:59:26 -0400
committerhistoria <historiavg@proton.me>2026-08-24 02:59:26 -0400
commitf00249db9d1ea051d29aa1bcca869fc4b88e83eb (patch)
treea75f076fac1b63e0b4bf2eb8f54affbcc681a891 /app/converter/config.py
parent9dd4f9595be3b1d76a3a07dc3eca90cfaf8a3f97 (diff)
downloadtts-audiobook-generator-f00249db9d1ea051d29aa1bcca869fc4b88e83eb.tar.gz
refactor: add app directory, dir structure change
Diffstat (limited to 'app/converter/config.py')
-rw-r--r--app/converter/config.py77
1 files changed, 77 insertions, 0 deletions
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 = ""