aboutsummaryrefslogtreecommitdiff
path: root/converter/config.py
blob: eb014627886868fbe527f5edb9a339fd03a828f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""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
VOICE_CLONE_API_URL = "http://127.0.0.1:7861"  # Base-model demo
FASTER_TTS_API_URL = "http://127.0.0.1:8000"  # faster-qwen3-tts server

# Words per TTS generation request. Each API call is ONE model generation:
# long generations lose prosody and can degrade into garbled audio.
CHUNK_SIZE_WORDS = 40
VOICE_CLONE_MAX_CHUNK_CHARS = 200  # Server-side re-chunking limit for clone requests
VOICE_CLONE_CHUNK_GAP = 0  # Pause (seconds) between server-side clone chunks
MIN_DELAY_BETWEEN_CHUNKS = 0  # Pause between API calls (rate-limit protection; local servers need none)

API_TIMEOUT = 300  # Seconds before an API call times out
MAX_RETRIES = 3  # Attempts per chunk request
HEARTBEAT_INTERVAL_SECONDS = 30  # Print "still working" this often during a chunk

LANGUAGE = "English"
SEED = -1

CUSTOM_VOICE_SPEAKER = "Vivian"
CUSTOM_VOICE_INSTRUCT = "Speak naturally and clearly, as if reading a dramatic book to an adult audience."

VOICE_CLONE_USE_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_TTS_VOICE = "default"

AUDIO_FORMAT = "m4b"  # Default output container
AUDIO_BITRATE = "128k"