Open joejohnmurphy opened 5 years ago
Hi Joe, I added a fix for this on the calculator and talker pages to the develop branch. I am using a "data-attribute" to identify the id of the sound element to be played. You can see how I am handling the backspace press event in calc.js and talker.js. I havent added the data-sound attribute to all the html pages yet, so I am keeping some of the old code in talker.js.
Let me know if this causes any issues to either the talker or calculator!
Thank you so much, Andrzej! I hope to test everything out this weekend. data-attribute
s are new to me and it looks really promising!
This appears to be working perfectly! I think the dev-soundlinks
branch is working really well. This has everything but the re-reading after pressing Enter, right? As noted on that issue, I'm wondering now if it is really needed given the differences in the content between the button labels and mp3s. What do you think?
I think you're right. Using the mp3s gives you a lot more flexibility on the speech vs. text that is read. I guess the only downside is you have to make the mp3s. I can roll-back develop to dev-soundlinks if that is our sweet spot right now.
Yes, I think rolling back develop to dev-soundlinks sounds like the way to go and then I'll merge develop into master. Does that sound good to you?
Sounds good to me! I rolled the dev-enter and added the rest of the sound attributes to develop. It should be ready to merge into master.
For example, each button currently has code like this in the html file:
<div class='btn f seafood' tabindex='1'>seafood</div>
<audio id='seafood' controls style='display:none'><source src='sounds/seafood.mp3' type='audio/mpeg'> Your browser does not support the audio element.</audio>
And this in the talker.js file:
if ($(':focus').hasClass('seafood')) {document.getElementById('seafood').play()}
Is there a way to streamline this so the repetitive code is eliminated and there's just a list of words referenced?