-
Notifications
You must be signed in to change notification settings - Fork 5
Description
We have duplicated code that determines if sound gets played in the sim:
Lines 218 to 226 in b3b1ef8
| Multilink.multilink( | |
| [ | |
| this.enabledProperty, | |
| audioEnabledProperty, | |
| simConstructionCompleteProperty, | |
| simVisibleProperty, | |
| simActiveProperty, | |
| simSettingPhetioStateProperty | |
| ], |
tambo/js/sound-generators/SoundGenerator.ts
Lines 117 to 125 in bc156bc
| this.fullyEnabledProperty = new DerivedProperty( | |
| [ | |
| soundManager.enabledProperty, | |
| this.enabledProperty, | |
| isResettingAllProperty, | |
| viewNodeDisplayedProperty, | |
| soundManager.extraSoundEnabledProperty, | |
| isSettingPhetioStateProperty | |
| ], |
These are similar, but a bit different, and it bit us over in https://github.com/phetsims/phet-studio/issues/15 because we would expect sounds to be disabled when the activeProperty is false, but SoundGenerator doesn't listen to that value. We were able to find a workaround there, but there are real concerns with trying to use the sim for PhET Studio and PhET-iO more generally that we don't have a complete shutoff valve for the sim sound.
@jbphet could we try to align these?
SoundGenerator is missing:
sim's activeProperty
audioEnabledProperty
simConstructionCompleteProperty,
simVisibleProperty,
SoundManager is missing:
isResettingAllProperty
I know these are joist/sim specific Properties that I'm asking to be a part of tambo code, so of course we need a more clever strategy than relying on joist directly, but I do feel like this discrepancy is awkward, and that it is only a matter of time because we come across a sound that really can only be silenced by its instance, and not globally (like a looping sound or something).
Also note that we have another list of potentially out of sync Properties we are listening to in audioManager for "speechAllowedProperty"
My questions for @jbphet (sorry implicate you):
- Do these discrepancies bother you as they do me?
- What do you think about that above list of missing Properties above?
- Should we factor out a collection of these into a single DerivedProperty that can be used in all cases?
Let's hear back from @jbphet, and then determine priority and champion, and scheduling.