Class AudioMixer
Namespace: ValveResourceFormat.Renderer.Audio
Assembly: Renderer.dll
Tracks active sound events and mixes their sample providers into a single continuous stereo stream.
public sealed class AudioMixer : IDisposableInheritance
Implements
Methods
CollectDebugSounds(List<(Vector3 Position, string Text)>, List<string>)
Collects the position and vsnd name of every audible positioned sound into positioned, and the vsnd name of every audible non-positioned (2D) sound into flat.
public void CollectDebugSounds(List<(Vector3 Position, string Text)> positioned, List<string> flat)Parameters
positioned List<(Vector3 Position, string Text)>
Dispose()
Stops and disposes all active sound events.
public void Dispose()Read(float[], int, int)
Mixes all active sounds into the buffer. Always fills the full buffer.
public int Read(float[] buffer, int offset, int count)Parameters
buffer float[]
offset int
count int
Returns
Update(Vector3, Vector3, Vector3, Vector3)
Updates spatialization for all active sound events. The three direction vectors are the listener's own head frame - taken from the camera rather than rebuilt here, since deriving them by cross product has no answer when the listener looks straight up or straight down.
public void Update(Vector3 listenerPosition, Vector3 listenerForward, Vector3 listenerRight, Vector3 listenerUp)Parameters
listenerPosition Vector3
listenerForward Vector3
listenerRight Vector3
listenerUp Vector3

