I have a function using Speech Synthesis. It works on its own while called onload:
function speak() {
var msg = new SpeechSynthesisUtterance();
var voices = voices[2];
msg.voiceURI = "native";
msg.volume = 2;
msg.rate = 1;
msg.pitch = 1;
msg.text = "Hello World";
msg.lang = "en";
speechSyntesis.speak(msg)}
But when called in my function which maps an array, with onmouseover, it becomes distorted.
if (el.toString === "Kinder.") return "<span class=\"tooltip\"><span onmouseover=\"speak()\">Kinder</span><span class=\"tooltiptext\" >Text</span></span>"
It works, but the voice sounds distorted. Does anyone know how to fix this?
Thanks in advance.
Edit: Works fine once, then stops working.