Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off sounds for most items #562

Closed
ariel-phet opened this issue Jan 16, 2020 · 18 comments
Closed

Turn off sounds for most items #562

ariel-phet opened this issue Jan 16, 2020 · 18 comments

Comments

@ariel-phet
Copy link

@samreid I believe the tambo works currently is that once you turn on sound, it is on for everything, on the lastest version "common" sounds are on for all buttons. Sims like CCK probably need a full sound design before we start using default sounds for common components (fine to leave the sound for the reset all button).

You should see how much effort it is to turn off these other sounds, and we might want to request the @jbphet change the current default in tambo. I believe @Denz1994 had to do the same for BAM, and I don't think it was much effort, but it would be good to have another data point.

@samreid
Copy link
Member

samreid commented Jan 16, 2020

@Denz1994 or @jbphet can you please advise how this can be accomplished?

@Denz1994
Copy link
Contributor

@samreid In most cases, I have been able to pass in an option for soundPlayer like this:

// Add button
     const button = new TextPushButton( nextCollectionString, {
       font: new PhetFont( {
         size: 18,
         weight: 'bold',
         maxWidth: BAMConstants.TEXT_MAX_WIDTH
       } ),
       baseColor: Color.ORANGE,
       soundPlayer: Playable.NO_SOUND
     } );

This does mean that tambo was added as a dependency for the sim, but the process was reletively straightforward.

@Denz1994
Copy link
Contributor

Also note @samreid, for classes whose options weren't exposed (due to composition or nesting). I had to go ahead and expose the options. Details are explained in phetsims/sun#547.

Unassigning until further input is needed.

@Denz1994 Denz1994 removed their assignment Jan 16, 2020
@samreid
Copy link
Member

samreid commented Jan 16, 2020

It does not seem practical to have to pass soundPlayer: Playable.NO_SOUND to numerous user interface components. @jbphet is there a better "shut off valve" for this?

@samreid samreid removed their assignment Jan 16, 2020
@samreid
Copy link
Member

samreid commented Jan 17, 2020

Bumping priority in hopes to address this before Jan 23 dev release.

@jbphet
Copy link
Contributor

jbphet commented Jan 17, 2020

I discussed this with @ariel-phet when common UI sounds were first integrated into master, and at the time we decided that using soundPlayer.NO_SOUND was a reasonable solution. @Denz1994 did it for Build a Molecule and didn't raise any objections. If this isn't working for you, then my suggestion would be that we tag all of the UI sounds as belonging to the user-interface class, and then turn that class all the way down.

Let me know which, if either, you'd prefer and we can work together to make it happen.

@jbphet jbphet assigned samreid and unassigned jbphet Jan 17, 2020
@samreid
Copy link
Member

samreid commented Jan 17, 2020

@ariel-phet or @kathy-phet is this important to complete before next week's dev version?

@samreid
Copy link
Member

samreid commented Jan 18, 2020

Specifying Playable.NO_SOUND in many places doesn't sound scalable. For instance, Playable.NO_SOUND occurs in 10 different places across 8 files in Build a Molecule, and if a new user interface component is added, there is a chance that this option would be omitted. I would recommend we pursue an alternate strategy. Let's discuss further!

@samreid
Copy link
Member

samreid commented Jan 18, 2020

I tried soundManager.setOutputLevelForClass( 'user-interface', 0 ); but it looks like some or all user interface sounds are not set up with that class. What would work well for CCK AC is to say "only sounds with class sim-specific should play", that way there is no opportunity for a sound to sneak in. Is something like that possible?

UPDATE: To use an analogy, some audio applications allow you to "solo" a track, or to "solo" multiple tracks, which effectively turns off any other tracks not marked as solo. In this case, it seems appropriate to use the string-based classes as soloable. An API could be soundManager.addSoloClass('class-name');

@samreid samreid assigned jbphet and unassigned samreid Jan 18, 2020
jbphet added a commit to phetsims/circuit-construction-kit-ac that referenced this issue Jan 20, 2020
@jbphet
Copy link
Contributor

jbphet commented Jan 20, 2020

I put all of the common UI sounds into the user-interface category and added a line to code to set the output level for these sounds to zero to CCK AC. This solves the issue that @samreid was describing, at least as well as I understand it. Back to @samreid for review.

@jbphet jbphet assigned samreid and unassigned jbphet Jan 20, 2020
@ariel-phet
Copy link
Author

@samreid this is not a requirement for the dev version you were asked to publish. As I mentioned, I just think this sim would require a full sound design before considering if the common component sounds work well with the rest of the simulation. I don't believe sound design is expected for V1, so it seems appropriate to turn these sounds off (except the reset all button).

@samreid
Copy link
Member

samreid commented Jan 21, 2020

It seems in CCK AC, it is impossible to generate 0.1 amps through the dog. The dog has a resistance of 100,000 ohms and the battery has a max voltage of 120V, so it would take around 83 batteries (n = 100000*0.1/120) to make the dog bark. I don't know of any plans to add high-voltage batteries to this sim, so perhaps we should disable the sound altogether? That way the speaker icon on the navigation bar won't be shown, and there won't be any possibility of single UI sound clips sneaking in. But in the preceding comment, it sounded like @ariel-phet favored the reset all button sound effect.

I recommend to disable all sound from CCK AC and to use the strategy @jbphet proposed for CCK DC when it is published again. @ariel-phet does this sound OK to you?

@samreid samreid assigned ariel-phet and unassigned samreid Jan 21, 2020
@ariel-phet
Copy link
Author

@samreid - I am fine with that for CCK AC, but CCK DC will be able to have the dog bark, so as long as the proposal works for a future update of CCK DC, I am fine going that route for the moment.

@ariel-phet ariel-phet assigned samreid and unassigned ariel-phet Jan 22, 2020
@samreid samreid removed their assignment Jun 11, 2020
@samreid
Copy link
Member

samreid commented Jul 27, 2020

For #589 @kathy-phet said:

Well, we haven't done a sound review. Is it possible to disable all common code sound, but leave the dog?
It's odd to have things like the carousel make sound, but not all the other sounds like picking up and dropping this and such.

I'll increase the priority and follow the recommendation above.

@samreid samreid self-assigned this Jul 27, 2020
samreid added a commit to phetsims/circuit-construction-kit-dc that referenced this issue Jul 27, 2020
samreid added a commit to phetsims/circuit-construction-kit-dc that referenced this issue Jul 27, 2020
@samreid
Copy link
Member

samreid commented Jul 27, 2020

I applied this strategy to CCK DC and verified that sounds only play for the dog bark. If more common code sounds creep in, we will need to make sure they are labeled as "user-interface". That's everything for this issue, closing.

@samreid samreid closed this as completed Jul 27, 2020
@arouinfar
Copy link
Contributor

@samreid this will need to be done in the DC - Virtual Lab flavor too. Currently, all user-interface sounds are present in master.

@samreid
Copy link
Member

samreid commented Jan 19, 2021

Fixed and confirmed on my side, @arouinfar can you please test?

@arouinfar
Copy link
Contributor

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants