fix(tts): make stepfun preset pick case-stable and per-character

- Hash the lowercased description (matching the case-insensitive scoring)
  so the same archetype text picks the same preset regardless of case.
- Thread the character name through provisionVoice -> stepfunProvision as
  the hash salt, so two characters that share archetype keywords spread
  across the top-N candidate presets instead of collapsing on one voice.

Xiaomi path is unaffected (voicedesign mints a unique clip per call).
This commit is contained in:
DESKTOP-I1T6TF3\Q
2026-06-09 09:14:44 +08:00
parent 19bbee16fe
commit 04f22249c9
4 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ export async function provisionCharacterVoice(
): Promise<CharacterVoice | undefined> {
if (!config.tts) return undefined;
try {
return await provisionVoice(config.tts, voiceDescription);
return await provisionVoice(config.tts, voiceDescription, charName);
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
console.error(`[characterDesigner] voice provision failed for ${charName}: ${msg}`);