You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Turn down the water drops, speaker or light sound when the wave meter is being used.this.duckingProperty=newDerivedProperty([series1PlayingProperty,series2PlayingProperty],(a,b)=>{if(a||b){return0.3;}else{return1;}});
And then that Property is observed elsewhere, to set the output of sound clips.
Problems:
(1) Insufficient documentation for duckingProperty. It's actually {number} and it's an output level.
(2) You're assuming (and hardcoding) a default output level of 1. That's incredibly brittle. Ditto for the ducked output level; it should be a function of the normal output level.
(3) This could be done without a Property, and with less coupling, by creating a sound category for the 3 clips that you want to duck. Then use soundManager.setOutputLevelForCategory to change their output level.
The text was updated successfully, but these errors were encountered:
Noted in phetsims/fourier-making-waves#55, where I was asked to use WaveMeterNode.js as an example of how to duck sounds.
In WaveMeterNode.js:
And then that Property is observed elsewhere, to set the output of sound clips.
Problems:
(1) Insufficient documentation for
duckingProperty
. It's actually{number}
and it's an output level.(2) You're assuming (and hardcoding) a default output level of 1. That's incredibly brittle. Ditto for the ducked output level; it should be a function of the normal output level.
(3) This could be done without a Property, and with less coupling, by creating a sound category for the 3 clips that you want to duck. Then use
soundManager.setOutputLevelForCategory
to change their output level.The text was updated successfully, but these errors were encountered: