Skip to content

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.

Terminal window
% ./plume3d audio_mixer_demo

You’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.

  • On init, creates three streaming sources (procedural sine tones) and three groups with Mixer.group("Music"), Mixer.group("SFX"), Mixer.group("Ambience"), then routes each tone to its group with group.addSource(...).
  • Each update, it feeds the tones (procedural PCM) and draws a control row per group — a sliderFloat for group.volume plus checkboxes for group.muted and group.soloed, and the same for Mixer.master.
  • The engine applies each group’s effective gain to its routed sources every frame, so the sliders, mute, and solo take effect immediately.
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 SFX
sfx.muted = true // silence all SFX
sfx.soloed = true // hear only SFX
  • Mixermaster, group, groupUnder, and the MixerGroup handle (volume, muted, soloed, addSource, addInstrument).
  • Audio — the streaming sources routed through the mixer.
  • Gui — the sliders and checkboxes.