From 062a2d0bd314fcbe0c52838df14f3d24c92d3af6 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sun, 12 Jul 2026 11:49:33 +0800 Subject: [PATCH] added support for qwen3tts aliases, replaces https://github.com/LostRuins/koboldcpp/pull/2315 --- koboldcpp.py | 3 +++ otherarch/tts_adapter.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index f8fde8ea5..ba66f9abd 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3023,6 +3023,7 @@ def tts_generate(genparams): speaker_json = tts_prepare_voice_json(genparams.get("speaker_json","")) #handle custom json voices voicestr = genparams.get("voice", genparams.get("speaker_wav", "")) oai_voicemap = ["alloy","onyx","echo","nova","shimmer"] # map to kcpp defaults + q3tts_voicemap = ["aiden","serena","ono_anna","ryan","sohee","eric","dylan","vivian","uncle_fu"] voice_mapping = voicelist normalized_voice = voicestr.strip().lower() if voicestr else "" if normalized_voice.endswith(".wav"): @@ -3031,6 +3032,8 @@ def tts_generate(genparams): voice = voice_mapping.index(normalized_voice) + 1 elif normalized_voice in oai_voicemap: voice = oai_voicemap.index(normalized_voice) + 1 + elif normalized_voice in q3tts_voicemap: + voice = q3tts_voicemap.index(normalized_voice) + 1 else: voice = simple_lcg_hash(voicestr.strip()) if voicestr else 1 inputs = tts_generation_inputs() diff --git a/otherarch/tts_adapter.cpp b/otherarch/tts_adapter.cpp index 0da9673d2..13906f3e9 100644 --- a/otherarch/tts_adapter.cpp +++ b/otherarch/tts_adapter.cpp @@ -1181,9 +1181,10 @@ static tts_generation_outputs ttstype_generate_qwen3tts(const tts_generation_inp std::string speaker_instruction = inputs.speaker_instruction; int speakerID = inputs.speaker_seed; + //{"aiden":2861, "dylan":2878, "eric":2875, "ono_anna":2873,"ryan":3061, "serena":3066, "sohee":2864, "uncle_fu":3010, "vivian":3065} int speakermap[] = {2861,3066,2873,3061,2864,2875,2878,3065,3010}; - if (speakerID > 0 && speakerID <= 5) { + if (speakerID > 0 && speakerID <= 9) { speakerID = speakermap[speakerID-1]; } else { speakerID = -1;