isDucked
Added in 6.5.0
Check whether a target is turned down at this moment, because one of the triggers you gave duck is playing and can be heard.
isDucked(target: string): boolean;
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
target | string | required | A target name you passed to duck. |
Returns
boolean: true while a trigger plays, false otherwise. Also false for a name that has no duck.
Example
soundHub.duck('music', { when: 'voice' });
soundHub.isDucked('music'); // false
soundHub.play('voice');
soundHub.isDucked('music'); // true
soundHub.pause('voice');
soundHub.isDucked('music'); // false, a paused trigger does not duck
Good to know
- It turns
truethe moment a trigger starts, before the attack ramp has finished, andfalsethe moment the last trigger stops, before the release ramp has finished. - It says nothing about whether the target itself plays. A duck follows its triggers either way.
- To react to the change rather than poll for it, listen for
duck_startedandduck_endedwithaddEventListener.
See also
getDuckLevel: the level the target is down to.duck: set up a duck.soundEvents: theduck_startedandduck_endedevents.