diff options
| author | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
| commit | 130dcd988e0554a6343c92fd45d808fd508789b3 (patch) | |
| tree | 0162c1593eff0f9214f111f600f23efd624eb3c3 /audiobook.py | |
| parent | 71f2c85aa5ea2aa5fe5f31537f5979459e82fcdd (diff) | |
| download | tts-audiobook-generator-130dcd988e0554a6343c92fd45d808fd508789b3.tar.gz | |
Diffstat (limited to 'audiobook.py')
| -rwxr-xr-x | audiobook.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/audiobook.py b/audiobook.py index 302bb17..a610caa 100755 --- a/audiobook.py +++ b/audiobook.py @@ -394,9 +394,22 @@ def convert(backend: str, voice: str = None, clone: str = None, print("[INFO] Conversion cancelled; nothing was converted") return 0 else: - # qwen: instructions design the voice (VoiceDesign model), a - # reference .wav clones one (Base), otherwise a built-in speaker. - if (instructions or "").strip(): + # qwen: a built-in speaker (CustomVoice — with the instructions + # text, if given, sent as that model's delivery/style control), a + # reference .wav clone (Base), or instructions alone designing the + # voice (VoiceDesign). Instructions never *switch* the mode: + # speaker+instructions is a directed CustomVoice run, and + # clone+instructions is refused — the Base demo has no + # voice-direction route, so silently redesigning the voice would + # drop the chosen reference. + wants_instructions = bool((instructions or "").strip()) + if clone and wants_instructions: + raise ValueError( + "The qwen-tts Base (voice cloning) demo cannot take style " + "instructions. Drop --instructions, or pick a CustomVoice " + "speaker with --voice (which sends them as delivery " + "control) or the VoiceDesign model (--instructions only).") + if wants_instructions and not (voice or "").strip(): voice_mode = VOICE_MODE_DESIGN else: voice_mode = VOICE_MODE_CLONE if clone else VOICE_MODE_CUSTOM |
