All examples · Audio · As Markdown, for AIs

Ducking

What this example shows

A sound with duck holds another channel down while it plays: here the roar takes the music to 25% and, once it is over, lets it back up in a second. There is nothing to undo: when the sound ends, is stopped or leaves with its object, the channel comes back up by itself.

It moves a volume of its own behind the channel, so the one useAudio().setVolume sets, the options screen's, stays where it was. The crack and the roar are not files: they are effects made from presets, useSound({ sfx: { preset } }).

Space for a home run.

Starting
Starting
—