Skip to content
matthieu chevrier edited this page Oct 3, 2020 · 1 revision

SETUP

TECHNO

HTML5

SpeechSynthesisUtterance

function test_languages(){
lang="fr-FR";
lang = "de-German"
lang = "zh-Chinese"

if (lang==="fr-FR") {
        var speech = new SpeechSynthesisUtterance('bravo');
        speech.lang = lang;
        window.speechSynthesis.speak(speech);
      }
else if (lang == "de-German") {
        var speech = new SpeechSynthesisUtterance('Stadt');
        speech.lang = lang;
        window.speechSynthesis.speak(speech);
      }
else if (lang == "zh-Chinese") {
      	var speech = new SpeechSynthesisUtterance('你好');
        speech.lang = lang;
        window.speechSynthesis.speak(speech);
      }
}
Clone this wiki locally