From e6ce7bd9c8c35801b7813dbd18bcca8c18f51a70 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Mon, 18 Aug 2025 11:27:29 -0600 Subject: [PATCH] Added images directory, attempted to fix speech playback --- images/cards_conversation_no.svg | 29 ++++++++++++++++++ images/cards_food_hungry.svg | 50 ++++++++++++++++++++++++++++++++ images/cards_food_thirsty.svg | 25 ++++++++++++++++ images/cards_people_father.svg | 22 ++++++++++++++ images/cards_people_mother.svg | 19 ++++++++++++ pecslib.js | 10 +++++-- 6 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 images/cards_conversation_no.svg create mode 100644 images/cards_food_hungry.svg create mode 100644 images/cards_food_thirsty.svg create mode 100644 images/cards_people_father.svg create mode 100644 images/cards_people_mother.svg diff --git a/images/cards_conversation_no.svg b/images/cards_conversation_no.svg new file mode 100644 index 0000000..7d676fa --- /dev/null +++ b/images/cards_conversation_no.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/cards_food_hungry.svg b/images/cards_food_hungry.svg new file mode 100644 index 0000000..e58296d --- /dev/null +++ b/images/cards_food_hungry.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/cards_food_thirsty.svg b/images/cards_food_thirsty.svg new file mode 100644 index 0000000..3a8450f --- /dev/null +++ b/images/cards_food_thirsty.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/cards_people_father.svg b/images/cards_people_father.svg new file mode 100644 index 0000000..8aca265 --- /dev/null +++ b/images/cards_people_father.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/cards_people_mother.svg b/images/cards_people_mother.svg new file mode 100644 index 0000000..dae693a --- /dev/null +++ b/images/cards_people_mother.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/pecslib.js b/pecslib.js index 8554e49..7cdbc81 100644 --- a/pecslib.js +++ b/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; }