Added images directory, attempted to fix speech playback

This commit is contained in:
2025-08-18 11:27:29 -06:00
parent 85b595f35d
commit e6ce7bd9c8
6 changed files with 153 additions and 2 deletions

View File

@@ -14,12 +14,18 @@ class pec {
root.appendChild(img);
var name = document.createElement("span");
name.innerText = word;
name.classList.add("pecNane");
name.classList.add("pecName");
root.appendChild(name);
root.mom = this;
root.addEventListener("click",(e)=>{
// tts synth api is inconsistant at best,
// need to find a more reliable solution.
var targ = e.currentTarget.mom;
window.speechSynthesis.speak(targ.utterance);
var utter = new SpeechSynthesisUtterance(targ.word);
console.log(targ.word);
utter.lang = utter.voice.lang
utter.onend = () => { console.log("Talked?"); };
window.speechSynthesis.speak(utter);
});
this.DOM = root;
}