Skip to main content

Ducking Audio

When music and voice signals are mixed together the desired behavior is often to lower the music signal's volume to make the voice signal more audible. This is a useful mechanism for listen together experiences where users also talk to each other.

Two signals are needed for this behavior:

  • The ducked signal: usually the music signal, the volume of this signal gets adjusted.
  • The ducking signal: this signal controls the ducking algorithm. This is usually the voice signal.

Ducking in an Audio Graph

In a Switchboard SDK audio graph the MusicDuckingNode can be used to duck a stereo signal based on another mono signal. MusicDuckingNode supports multiple ducking signals. You can adjust the following parameters on this node:

NodeDescription
Ducking AmountControls the maximum amount by which the volume is lowered.
Ducking Release AmountControls how quickly the volume returns to the original level.
Num Seconds to Hold DuckingControls how long the volume level stays at the ducked level.

Check out the Music Ducking Example to see how ducking can be used in an audio graph.

Ducking an External Signal

Sometimes certain audio sources need to be ducked which don't provide PCM access to their audio signal. For example some video players don't provide access to the audio signal, but they have a volume setting that can be adjusted. In this case a DuckingDelegate can be set which sends the expected volume levels to the integrating app. The integrating app can then use this value to adjust the audio source's volume level.