Skip to main content

unduck

Added in 6.5.0

Remove the duck from a target. From then on the target no longer drops when its triggers play, and it goes straight back to its own level.

unduck(target: string): void;

Parameters​

ParameterTypeDefaultDescription
targetstringrequiredA target name you passed to duck.

Returns​

Nothing.

Example​

soundHub.duck('music', { when: 'voice' });

soundHub.play('music', { loop: true });
soundHub.play('voice');

// The voice is still talking, but the music comes back now
soundHub.unduck('music');
soundHub.isDucked('music'); // false

Good to know​

  • The level jumps back to 1 without the release ramp. For a smooth return, let the trigger stop instead.
  • When the target was down, duck_ended is dispatched with volume: 1.
  • The target's sounds go back to playing straight into the master bus.
  • A name that has no duck is ignored.
  • duck() with a list of targets sets up one duck per target, so unduck removes one of them and leaves the rest. The function duck() returns removes all of them.

See also​

  • duck: set up a duck, and get a function that removes it.
  • isDucked: whether a target is down right now.
  • Ducking: the overview.