phetsims / utterance-queue

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

[safari] Voicing/SpeechSynthesis is buggy in multiple iframes #92

Open zepumph opened 2 years ago

zepumph commented 2 years ago

@Nancy-Salpepi reported this bug originally in https://github.com/phetsims/phet-io-wrappers/issues/459. We are finding that our voicing in our sims behaves quite badly when running multiple sims in iframes on the same page in safari.

Test 1:


<iframe src="https://phet-dev.colorado.edu/html/ratio-and-proportion/1.2.0-dev.31/phet/ratio-and-proportion_all_phet.html?voicingInitiallyEnabled&preferencesStorage"></iframe>
<iframe src="https://phet-dev.colorado.edu/html/ratio-and-proportion/1.2.0-dev.31/phet/ratio-and-proportion_all_phet.html?voicingInitiallyEnabled&preferencesStorage"></iframe>
<iframe src="https://phet-dev.colorado.edu/html/ratio-and-proportion/1.2.0-dev.31/phet/ratio-and-proportion_all_phet.html?voicingInitiallyEnabled&preferencesStorage"></iframe>

This consistently showed that the last iframe's voicing worked perfectly, but the other two were silent. Behavior is great on chrome, with all three iframes working.

Then I added @marlitas and @samreid (our resident safari devices holders) and we made this test:

**iframe contents:** ```html Speech synthesiser

Speech synthesiser

Enter some text in the input below and press return or the "play" button to hear it. change voices using the dropdown menu.

1
1
``` **outer webpage:** ```html ```

In that we got semi sporadic behavior where it is possible that when only interacting with iframe 1, we hear a single voiced alert and then never hear anything again.

It is also possible that we hear everything from iframe 1, but then when go to use the second iframe, we hear just a single voiced alert, and then never anything again. We will need to investigate more, but I believe this should block voicing sims until we learn more about it.

zepumph commented 2 years ago

Tagging @jessegreenberg.

jessegreenberg commented 2 years ago

Bummer. Did the problem only present itself when changing the voice and its rate and pitch? I am wondering if it would happen if html.html is reduced to a button whose click listener is just

window.speechSynthesis.speak( new SpeechSynthesisUtterance( 'This is a test' ) );
zepumph commented 2 years ago

@emily-phet and I spoke about this today and don't think that we should investigate this right now. Unmarking as blocking.

Nancy-Salpepi commented 1 year ago

Noting this is still an issue using macOS 13.1 and safari 16.2 while testing https://github.com/phetsims/qa/issues/886