Module audio

Source
Expand description

Shared runtime audio. Rust owns clips, voices and mixing; hosts consume PCM.

Modules§

batch
Bounded presentation-frame batching of caller-accepted events.

Structs§

AcousticProfile
AcousticScene
AcousticTransition
An allocation-free, opt-in transition between room/occlusion profiles.
AcousticZone
AdaptiveScore
Two phase-aligned original stems. Starts/restarts both together after host suspension and crossfades gains on musical bars without restarting cursors.
Clip
GameAudio
Local gameplay audio with explicit suspension, independent of simulation time.
MixStats
Mixer
MusicConductor
MusicFrame
OutputStats
Sound
A clip whose sample and metadata validation is complete. Keep a bank owner alive during real-time playback if the last Arc must not free in render.
SoundBank
VoiceHandle
VoiceParams
VoicePolicy
Opt-in reservation using the existing VoiceParams::priority scale.

Enums§

AcousticTransitionError
Invalid input to an AcousticTransition. Errors leave its state unchanged.
Bus
Cue
Spatial
Surface
VoiceAdmission
Explicit admission result, including the invalidated handle after a steal. See Mixer::start_with_outcome for a compiling example.
VoiceRejection
Why Mixer::start_with_outcome did not admit a voice.

Constants§

MAX_CLIP_FRAMES
Maximum decoded interleaved-stereo storage: 64 MiB, also bounded to 10 minutes.
MAX_PULL_FRAMES
SAMPLE_RATE

Functions§

bus_gains
encode_wav
listener
master_gain
music_stems
Original short synchronized stems, synthesized at setup; no asset download.
muted
output_stats
play
play_sound
playing
preload_cues
Generate the built-in bank outside a frame/audio callback when desired.
render
For a host output callback, limited to 4096 frames and a valid device rate. This runs on the game/Wasm thread; devices never borrow this mixer directly.
set_bus_gain
set_master_gain
set_muted
set_params
stats
stop
stop_all
suspend