Skip to content

Commit

Permalink
update speakingProperty even with Chromebook workaround, see phetsims…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Feb 7, 2022
1 parent f3ed08c commit beb44ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/accessibility/voicing/voicingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ class VoicingManager extends Announcer {
this.timeSinceWakingEngine += dt;
if ( !this.speakingProperty.value && this.voicingQueue.length === 0 && this.timeSinceWakingEngine > ENGINE_WAKE_INTERVAL ) {
this.timeSinceWakingEngine = 0;

// the speakingProperty needs to be set to true before requesting speech even for this workaround so that
// the speakingProperty and synth.isSpeaking are in sync
this.speakingProperty.set( true );
this.getSynth().speak( new SpeechSynthesisUtterance( '' ) );

// cancel immediately to keep the speakingProperty up to date even with this workaround
Expand Down

0 comments on commit beb44ad

Please sign in to comment.