phetsims / utterance-queue

Alerting library powered by aria-live
http://scenerystack.org/
MIT License
1 stars 2 forks source link

getSynth()!.addEventListener crashing in Safari #107

Closed chrisklus closed 1 year ago

chrisklus commented 1 year ago

@amanda-phet found that Number Compare/Play was not launching in Safari after @jessegreenberg and I made a change to use an event listener to listen for when voices are populated.

chrisklus commented 1 year ago

We investigated and found that Safari has a more limited API for speechSynthesis, so we added a guard to first check to see if the synth has addEventListener before calling it to listen to voiceschanged. It seems like Safari has voices on page load so there is no need to listen to changes in the voices.

We tested this in Chrome and Safari and things seems to be working well. Closing.