Audio Mixer
App: apps/audio_mixer_demo/
Three procedural tones stand in for three categories of game audio — Music, SFX, and Ambience
(engine PLM-147 / ADR 0046). Each is an ordinary streaming Source routed to its own
mixer group. The per-group volume slider, mute, and solo then control whole
categories at once, plus a Master group that scales everything.
Run from root
Section titled “Run from root”% ./plume3d audio_mixer_demoYou’ll hear three sustained tones (a mid drone, a high tone, a low hum). Drag a group’s slider and the whole category changes; mute or solo a group to hear the effect.
What it does
Section titled “What it does”- On
init, creates three streaming sources (procedural sine tones) and three groups withMixer.group("Music"),Mixer.group("SFX"),Mixer.group("Ambience"), then routes each tone to its group withgroup.addSource(...). - Each
update, it feeds the tones (procedural PCM) and draws a control row per group — asliderFloatforgroup.volumepluscheckboxes forgroup.mutedandgroup.soloed, and the same forMixer.master. - The engine applies each group’s effective gain to its routed sources every frame, so the sliders, mute, and solo take effect immediately.
Key pattern
Section titled “Key pattern”import "engine" for Audio, Mixer
// init: route a source to a group.var shot = Audio.newSource("sfx/shot.wav")var sfx = Mixer.group("SFX")sfx.addSource(shot)
// anytime: ride the whole category.sfx.volume = 0.5 // half-volume SFXsfx.muted = true // silence all SFXsfx.soloed = true // hear only SFX