phetsims / phetsims/wave-interference

Issues with sound ducking

Open
#521 8 comments 0 reactions 1 assignee View on GitHub

@jbphet is already working on this.

Since Jun 26, 2026.

dev:sound priority:5-deferred
Dominant language
TypeScript
Stars
20
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Noted in https://github.com/phetsims/fourier-making-waves/issues/55, where I was asked to use WaveMeterNode.js as an example of how to duck sounds.

In WaveMeterNode.js:

    // Turn down the water drops, speaker or light sound when the wave meter is being used.
    this.duckingProperty = new DerivedProperty( [ series1PlayingProperty, series2PlayingProperty ], ( a, b ) => {
      if ( a || b ) {
        return 0.3;
      }
      else {
        return 1;
      }
    } );

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.