lang
This commit is contained in:
@@ -276,14 +276,14 @@ function gameOver() {
|
||||
|
||||
stats.show();
|
||||
playSound(gameover)
|
||||
speak("Game over")
|
||||
speak("Game over", 'en-US')
|
||||
}
|
||||
|
||||
function speak(text) {
|
||||
function speak(text, lang='fr-FR') {
|
||||
if (!window.speechSynthesis) return;
|
||||
|
||||
const utterance = new SpeechSynthesisUtterance(text);
|
||||
utterance.lang = 'fr-FR';
|
||||
utterance.lang = lang;
|
||||
utterance.volume = sfxVolumeRange.value;
|
||||
speechSynthesis.speak(utterance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user