mirror of
https://forge.murkfall.net/bluesaxman/librePECS.git
synced 2026-03-13 02:04:20 -06:00
Added images directory, attempted to fix speech playback
This commit is contained in:
10
pecslib.js
10
pecslib.js
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user