Speak onboarding and all game dialogue automatically
Build and publish frontend / publish (push) Successful in 38s
Build and publish frontend / publish (push) Successful in 38s
This commit is contained in:
@@ -42,11 +42,13 @@
|
||||
}
|
||||
const stored = JSON.parse(current || '{}');
|
||||
const settings = {...DEFAULT_SETTINGS, ...stored};
|
||||
if (!['screen-reader', 'game-voice', 'text-only'].includes(settings.mode)) settings.mode = DEFAULT_SETTINGS.mode;
|
||||
// Game dialogue is always spoken. These assignments also migrate older
|
||||
// local settings that allowed text-only or screen-reader-only playback.
|
||||
settings.mode = 'game-voice';
|
||||
settings.autoSpeak = true;
|
||||
settings.rate = Math.min(2, Math.max(0.5, Number(settings.rate) || 1));
|
||||
settings.voiceName = typeof settings.voiceName === 'string' ? settings.voiceName : '';
|
||||
settings.speakerProfiles = settings.speakerProfiles && typeof settings.speakerProfiles === 'object' ? settings.speakerProfiles : {};
|
||||
settings.autoSpeak = settings.autoSpeak === true;
|
||||
settings.soundSignals = settings.soundSignals !== false;
|
||||
return settings;
|
||||
} catch (_) { return {...DEFAULT_SETTINGS}; }
|
||||
@@ -177,7 +179,7 @@
|
||||
}
|
||||
|
||||
function speak(text, voiceOptions = {}) {
|
||||
if (!text || settings.mode !== 'game-voice' || !win.speechSynthesis || !win.SpeechSynthesisUtterance) return false;
|
||||
if (!text || !win.speechSynthesis || !win.SpeechSynthesisUtterance) return false;
|
||||
stopListening();
|
||||
cancelSpeech();
|
||||
const token = generation;
|
||||
|
||||
Reference in New Issue
Block a user