Class SampleProvider3D
Namespace: ValveResourceFormat.Renderer.Audio.SampleProviders
Assembly: Renderer.dll
A positional sound with stereo panning and distance based attenuation. Attenuation follows when set, otherwise a simple exponential falloff over .
public class SampleProvider3D : SampleProviderSpatial, IAudioSampleProviderInheritance
object ← AudioSampleProvider ← SampleProvider2D ← SampleProviderSpatial ← SampleProvider3D
Implements
Inherited Members
SampleProviderSpatial.LeftVolume, SampleProviderSpatial.RightVolume, SampleProviderSpatial.LastLeftVolume, SampleProviderSpatial.LastRightVolume, SampleProviderSpatial.Read(float[], int, int), SampleProviderSpatial.Update(Vector3, Vector3), SampleProviderSpatial.SnapVolumesOnFirstUpdate(), SampleProviderSpatial.ResetInterpolation(), SampleProviderSpatial.GetDirectionMix(Vector3, Vector3), SampleProvider2D.Provider, SampleProvider2D.Read(float[], int, int), AudioSampleProvider.OnOver, AudioSampleProvider.Volume, AudioSampleProvider.VolumeMultiplier, AudioSampleProvider.Read(float[], int, int), AudioSampleProvider.Over()
Constructors
SampleProvider3D(IAudioSampleProvider)
Creates a positional provider around the given source.
public SampleProvider3D(IAudioSampleProvider provider)Parameters
provider IAudioSampleProvider
Properties
DistanceVolumeCurve
Gets or sets the distance to volume mapping curve ("distance_volume_mapping_curve").
public SoundEventCurve? DistanceVolumeCurve { get; set; }Property Value
OcclusionTarget
Gets or sets the attenuation to move towards while geometry blocks the sound (1 unoccluded, 0 fully muted). The applied value is smoothed across updates.
public float OcclusionTarget { get; set; }Property Value
OutOfRange
Gets whether the listener was outside the audible range during the last update.
public bool OutOfRange { get; }Property Value
Position
Gets or sets the world position of the sound.
public Vector3 Position { get; set; }Property Value
Range
Gets or sets the audible range used by the fallback falloff when no volume curve is set.
public float Range { get; set; }Property Value
StereoMixCurve
Gets or sets the distance to unfiltered-stereo mapping curve ("distance_unfiltered_stereo_mapping_curve"). At 1 the sound plays as plain centered stereo, at 0 it is fully spatialized.
public SoundEventCurve? StereoMixCurve { get; set; }Property Value
Methods
GetDirectionMix(Vector3, Vector3)
Returns how much the sound leans towards the right ear (-1 fully left, 1 fully right).
protected override float GetDirectionMix(Vector3 listenerPosition, Vector3 rightEarDirection)Parameters
listenerPosition Vector3
rightEarDirection Vector3
Returns
ResetInterpolation()
Resets the interpolation state so the next update snaps to its target instead of fading in from wherever this provider last left off. Call when reusing this instance for a new (e.g. retriggered) sound.
public override void ResetInterpolation()Update(Vector3, Vector3)
Recomputes the per-ear volumes for the given listener. Returns whether the sound is currently audible.
public override bool Update(Vector3 listenerPosition, Vector3 rightEarDirection)Parameters
listenerPosition Vector3
rightEarDirection Vector3

