From beb44add0671f41cc016b5a4e02a0c34b1a4edc1 Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 26 Oct 2021 18:11:11 -0400 Subject: [PATCH] update speakingProperty even with Chromebook workaround, see https://github.com/phetsims/gravity-force-lab-basics/issues/303 --- js/accessibility/voicing/voicingManager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/accessibility/voicing/voicingManager.js b/js/accessibility/voicing/voicingManager.js index 17d4973..16312e5 100644 --- a/js/accessibility/voicing/voicingManager.js +++ b/js/accessibility/voicing/voicingManager.js @@ -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