Skip to content

Audio Ducking

App: apps/audio_ducking_demo/

A continuous music drone that automatically ducks (drops in level) while a “voice” cue plays (engine PLM-148 / ADR 0047) — the classic music-under-dialogue effect. Hold Space to talk; the music dips, then swells back when you stop.

Terminal window
% ./plume3d audio_ducking_demo

Hold Space: the second tone (the “voice”) sounds and the music drone ducks about 14 dB; release it and the music rises back over ~400 ms. A bar shows the music’s live duck level.

  • Creates a Music drone and a Voice tone, each an ordinary streaming Source routed to a Mixer.group (Music / Voice).
  • Configures the sidechain once: music.duckUnder(voice, -14, 0.05, 0.4) — duck 14 dB, 50 ms attack, 400 ms release.
  • Feeds the Music tone every frame (always playing) but only feeds the Voice tone while Space is held. The engine sees a playing source on the Voice bus and ducks the Music bus automatically — no per-frame ducking code in the game.
  • Draws the Music group’s duckGain as a Gui.progress bar.
import "engine" for Mixer
var music = Mixer.group("Music")
var voice = Mixer.group("Voice")
// Configure once — the engine applies it every frame.
music.duckUnder(voice, -14, 0.05, 0.4) // amountDb, attack s, release s
// ...later, drive the trigger by playing sound on the Voice bus.
  • MixerMixerGroup.duckUnder, clearDuck, duckGain.
  • Audio — the streaming sources on each bus.
  • Gui — the duck-level bar.