Skip to content

Commit

Permalink
When sound is enabled for the Fourier series, duck all user-interface…
Browse files Browse the repository at this point in the history
… sounds, #55
  • Loading branch information
pixelzoom committed Apr 15, 2021
1 parent 64536d3 commit 2bfa5bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/discrete/model/DiscreteModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import NumberProperty from '../../../../axon/js/NumberProperty.js';
import Property from '../../../../axon/js/Property.js';
import Range from '../../../../dot/js/Range.js';
import merge from '../../../../phet-core/js/merge.js';
import soundManager from '../../../../tambo/js/soundManager.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import FMWSymbols from '../../common/FMWSymbols.js';
import Domain from '../../common/model/Domain.js';
Expand Down Expand Up @@ -151,6 +152,11 @@ class DiscreteModel {
this.equationFormProperty.value = EquationForm.HIDDEN;
}
} );

// When sound is enabled for the Fourier series, duck all user-interface sounds.
this.fourierSeriesSoundEnabledProperty.link( enabled => {
soundManager.setOutputLevelForCategory( 'user-interface', enabled ? 0.1 : 1 );
} );
}

/**
Expand Down

0 comments on commit 2bfa5bf

Please sign in to comment.