Skip to main content

Module mixer

Module mixer 

Source
Expand description

Spatial audio mixer — buses, ducking, reverb send, stereo panning, distance attenuation.

The mixer is structured around named buses:

  • Music bus: looping background audio, cross-fades on vibe change
  • SFX bus: one-shot sound effects with 3D attenuation
  • Ambient bus: looping environmental drones
  • UI bus: non-spatial UI sounds

The master bus applies limiting and optional reverb send before output.

Structs§

Bus
Volume and mute state for a single bus.
ChannelStrip
A 3D positioned audio source channel.
Compressor
RMS compressor for dynamic range control.
Limiter
Simple lookahead peak limiter to prevent clipping.
Mixer
The master audio mixer — manages buses, channels, and effects.
StereoFrame
A stereo audio frame (left, right) in [-1, 1].

Enums§

AttenuationModel
Model for how volume decreases with distance.
BusId
Named audio bus identifiers.

Functions§

attenuate
Compute volume [0, 1] from distance and attenuation model.
spatial_weight
Mix weight for a source given listener position and source position.
stereo_pan
Compute stereo pan from a 3D position relative to listener. Returns (left, right) gain in [0, 1].