This commit is contained in:
@@ -233,9 +233,14 @@
|
||||
utterance.pitch = isNarrator ? 1 : Math.min(2, Math.max(0, Number(voiceOptions.pitch ?? profile.pitch ?? identityProfile.pitch) || 1));
|
||||
const requestedName = voiceOptions.voiceName || profile.voiceName || settings.voiceName;
|
||||
const voices = availableVoices();
|
||||
utterance.voice = voices.find(voice => voice.name === requestedName)
|
||||
|| voices.find(voice => /^sv(-|$)/i.test(voice.lang))
|
||||
|| null;
|
||||
// An empty selection means the operating system should choose its
|
||||
// default voice for the requested language. Forcing the first voice
|
||||
// returned by WebKit can select a voice that is listed but cannot speak.
|
||||
utterance.voice = requestedName
|
||||
? voices.find(voice => voice.name === requestedName)
|
||||
|| voices.find(voice => /^sv(-|$)/i.test(voice.lang))
|
||||
|| null
|
||||
: null;
|
||||
utterance.onstart = () => {
|
||||
if (token !== generation) return;
|
||||
if (speechStartTimer !== null) win.clearTimeout(speechStartTimer);
|
||||
|
||||
Reference in New Issue
Block a user