Adjust system TTS

This commit is contained in:
SillyLossy
2023-05-05 02:44:23 +03:00
parent 92e508a076
commit 1d10b8f390
3 changed files with 20 additions and 2 deletions

View File

@ -84,7 +84,10 @@ class SystemTtsProvider {
return [];
}
return speechSynthesis.getVoices().map(x => ({ name: x.name, voice_id: x.voiceURI, preview_url: '' }));
return speechSynthesis
.getVoices()
.sort((a, b) => a.lang.localeCompare(b.lang) || a.name.localeCompare(b.name))
.map(x => ({ name: x.name, voice_id: x.voiceURI, preview_url: '', lang: x.lang }));
}
previewTtsVoice(voiceId) {