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
| Parameter | Type | Default | Description |
|---|---|---|---|
target | string | required | A 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_endedis dispatched withvolume: 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, sounduckremoves one of them and leaves the rest. The functionduck()returns removes all of them.