phetsims / vibe

Library for handling audio for PhET simulations. Provides cross-platform support and enables usage of base64 audio embedded in an HTML document.
MIT License
3 stars 3 forks source link

Add second argument 'soundEnabledProperty' to Sound? #11

Closed samreid closed 5 years ago

samreid commented 10 years ago

I think it will clean up several usage sites if we can add a second parameter to the Sound constructor, which is a Property for soundEnabledProperty. This will be an optional parameter, and when the sound is played, if this parameter was provided the sound will only be played if the sound was enabled.

An alternative would be to add a Static method on Sound that turns all sound on/off. Let's discuss.

jbphet commented 10 years ago

@samreid and I discussed, and we are currently thinking that we should have a single static property in the Sound class that can be used to enable/disable all sound production. If we ever need finer granularity, we can add the individual 2nd parameter described in the first comment.

samreid commented 10 years ago

In the above commit, I Added an axon Property audioEnabledProperty which is used as a global audio on/off flag. I tested a few sims that it is working properly. Once sims are using this flag, then GameAudioPlayer could be rewritten.

pixelzoom commented 9 years ago

See https://github.com/phetsims/vibe/issues/12. I'm not convinced that having a global soundEnabledProperty is a good idea.

jbphet commented 5 years ago

Vibe is not going to be used as our main sound library moving forward, and global on/off of sound has been implemented in tambo, which is the new sound library. Eventually, vibe will be deprecated and, with that in mind, it's not worth spending any effort on a four-year-old GitHub issue. Closing.