Merge develop → main: fix Brave TTS voice proxy crash (#63)
This commit is contained in:
+4
-1
@@ -12663,7 +12663,10 @@ function _initBrowserTtsVoices(selectedVoice) {
|
|||||||
const populate = () => {
|
const populate = () => {
|
||||||
let voices = [];
|
let voices = [];
|
||||||
try {
|
try {
|
||||||
voices = (window.speechSynthesis.getVoices() || []).filter(v => v != null && v.lang);
|
voices = (window.speechSynthesis.getVoices() || []).filter(v => {
|
||||||
|
try { return v != null && typeof v.lang === 'string' && v.lang.length > 0; }
|
||||||
|
catch (_) { return false; }
|
||||||
|
});
|
||||||
} catch (_) { return false; }
|
} catch (_) { return false; }
|
||||||
if (!voices.length) return false;
|
if (!voices.length) return false;
|
||||||
// Italian voices first, then others
|
// Italian voices first, then others
|
||||||
|
|||||||
Reference in New Issue
Block a user