Skip to content

Commit

Permalink
add audioManager.audioEnabledProperty to dependencies for SpeechSynth…
Browse files Browse the repository at this point in the history
…esisButton.enabledProperty, #45
  • Loading branch information
pixelzoom committed Feb 1, 2023
1 parent 5c4639c commit a044665
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/common/view/SpeechSynthesisButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import NumberSuiteCommonSpeechSynthesisAnnouncer from './NumberSuiteCommonSpeech
import UtteranceQueue from '../../../../utterance-queue/js/UtteranceQueue.js';
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import PhetColorScheme from '../../../../scenery-phet/js/PhetColorScheme.js';
import audioManager from '../../../../joist/js/audioManager.js';

type SelfOptions = {
stringProperty?: TReadOnlyProperty<string> | null;
Expand Down Expand Up @@ -89,13 +90,14 @@ class SpeechSynthesisButton<P extends NumberSuiteCommonPreferences,
} );

Multilink.multilink( [
audioManager.audioEnabledProperty,
options.comparisonSignsAndTextVisibleProperty,
speechSynthesisAnnouncer.primaryLocaleVoiceEnabledProperty,
speechSynthesisAnnouncer.secondaryLocaleVoiceEnabledProperty,
isPrimaryLocaleProperty
],
( comparisonSignsAndTextVisible, primaryLocaleVoiceEnabled, secondaryLocaleVoiceEnabled, isPrimaryLocale ) => {
this.enabled = comparisonSignsAndTextVisible &&
( audioEnabled, comparisonSignsAndTextVisible, primaryLocaleVoiceEnabled, secondaryLocaleVoiceEnabled, isPrimaryLocale ) => {
this.enabled = audioEnabled && comparisonSignsAndTextVisible &&
( isPrimaryLocale ? primaryLocaleVoiceEnabled : secondaryLocaleVoiceEnabled );
} );
}
Expand Down

0 comments on commit a044665

Please sign in to comment.