Closed zepumph closed 2 years ago
One reason I want this is so that in https://github.com/phetsims/utterance-queue/issues/22 we can use UtteranceQueue.canAlertUtterance
as a central place to check if PhET-iO state is being set. Would that work?
I spoke with @jessegreenberg, we will add this support, and perhaps factor this out with the announce() call to another function in UtteranceQueue called both by immediately and not immediately announcings.
I ended up getting rid of canAlertUtterance, in exchange for a factored out function that checks the same conditions, and then announces (attemptToAnnounce). Closing
Even though this function is meant to immediately announce an utterance, bypassing the queue, it still feels like we should be utilizing the same type of algorithm where we adhere to the Utterance's predicate. What do you think?