diff options
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 |
