phetsims / utterance-queue

Alerting library powered by aria-live
MIT License
0 stars 2 forks source link

Chromebook workaround is breaking speech synthesis #104

Closed jessegreenberg closed 1 year ago

jessegreenberg commented 1 year ago

@chrisklus and I found that the "engine wake for Chromebook" workaround is causing more problems. Here is the code:

https://github.com/phetsims/utterance-queue/blob/981537e9a6fc60f9d3ee8c236a73e13db1f25fbd/js/SpeechSynthesisAnnouncer.ts#L449-L460

We found this code because number-play is now using two instances of SpeechSynthesisAnnouncer and I was most worried about this section while using two instances. To test, we reduced the ENGINE_WAKE_INTERVAL to a very small value to trigger lots of interruptions. The result was almost no speech synthesis in number-play. But then we removed the second SpeechSynthesisAnnouncer instance and still saw the problem. So something is fundamentally wrong with this workaround and may be causing problems in the wild.

Testing devices was Chrome 108, macOS 12.6.

jessegreenberg commented 1 year ago

In #110 we reduced the workaround to only be applied on ChromeOS. If we can verify that this workaround doesn't interrupt speak on ChromeOS this can be closed.

jessegreenberg commented 1 year ago

I reduced the ENGINE_WAKE_INTERVAL to 500 ms and saw no problems, interruptions, or inability for the synth to speak. When we saw problems originally it might have been because two instances of SpeechSynthesisAnnouncer were used. That is no longer possible after #108. Maybe there were other sim specific problems. Closing.