fix(tts): fixed incorrectly selected voices, closes #2386 (#2426)

This commit is contained in:
Huang Xin
2025-11-10 02:11:12 +08:00
committed by GitHub
parent c539917d7e
commit e3f7abf7f1
@@ -58,7 +58,7 @@ export class EdgeTTSClient implements TTSClient {
const availableVoices = (await this.getVoices(lang))[0]?.voices || [];
let defaultVoice: TTSVoice | null = availableVoices[0] || null;
if (defaultVoice?.id === 'en-US-AnaNeural') defaultVoice = null; // avoid using AnaNeural as default
if (defaultVoice?.id === 'en-US-AnaNeural') return 'en-US-AriaNeural'; // avoid using AnaNeural as default
return defaultVoice?.id || this.#currentVoiceId || 'en-US-AriaNeural';
};