Skip to content

Commit

Permalink
cancel synth to keep speakingProperty in synch for phetsims/gravity-f…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Feb 7, 2022
1 parent c543352 commit f3ed08c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/accessibility/voicing/voicingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ class VoicingManager extends Announcer {
if ( !this.speakingProperty.value && this.voicingQueue.length === 0 && this.timeSinceWakingEngine > ENGINE_WAKE_INTERVAL ) {
this.timeSinceWakingEngine = 0;
this.getSynth().speak( new SpeechSynthesisUtterance( '' ) );

// cancel immediately to keep the speakingProperty up to date even with this workaround
this.cancelSynth();
}
}
}
Expand Down

0 comments on commit f3ed08c

Please sign in to comment.