SoundHandleclass
A handle to a sound that is currently playing. You can use this to control the sound's position, volume, pitch etc.
Methods7
Showing 7 methods
public void ClearParent()
Clear our parent - stop following
Obsolete: Just use Parent property directly
void—public virtual sealed void Dispose()
void—protected virtual override void Finalize()
void—public static void GetActive(System.Collections.Generic.List`1<Sandbox.SoundHandle> handles)
| Parameter | Type | Description |
|---|---|---|
| handles | List<SoundHandle> | — |
void—public void SetParent(Sandbox.GameObject obj)
Tell the SoundHandle to follow this GameObject's position
Obsolete: Just use Parent property directly
| Parameter | Type | Description |
|---|---|---|
| obj | GameObject | — |
void—public void Stop(float fadeTime = 0)
| Parameter | Type | Description |
|---|---|---|
| fadeTime = 0 | float | — |
void—public void Update()
Called to push changes to a sound immediately, rather than waiting for the next tick. You should call this if you make changes to a sound.
Obsolete: This no longer needs to exist
void—No results match this filter.
Properties37
Showing 37 properties
public bool Sandbox.SoundHandle.AirAbsorption { get; set; }
Should the sound get absorbed by air, so it sounds different at distance
bool—public float Sandbox.SoundHandle.Amplitude { get; set; }
Measure of audio loudness.
float—public float Sandbox.SoundHandle.Decibels { get; set; }
Obsolete: This is not used anymore
float—public float Sandbox.SoundHandle.Distance { get; set; }
How many units the sound can be heard from.
float—public bool Sandbox.SoundHandle.DistanceAttenuation { get; set; }
Should the sound fade out over distance
bool—public float Sandbox.SoundHandle.ElapsedTime { get; set; }
Obsolete: Use Time instead
float—public Sandbox.Curve Sandbox.SoundHandle.Fadein { get; set; }
The fadein curve for when the sound starts.
public Sandbox.Curve Sandbox.SoundHandle.Fadeout { get; set; }
The fadeout curve for when the sound stops.
public Sandbox.Curve Sandbox.SoundHandle.Falloff { get; set; }
The falloff curve for the sound.
public bool Sandbox.SoundHandle.Finished { get; set; }
Sound is done
bool—public bool Sandbox.SoundHandle.FollowParent { get; set; }
Update our position every frame relative to our parent
bool—public bool Sandbox.SoundHandle.IsPlaying { get; set; }
Whether the sound is currently playing or not.
bool—public bool Sandbox.SoundHandle.IsStopped { get; set; }
True if the sound has been stopped
bool—public virtual sealed bool Sandbox.SoundHandle.IsValid { get; set; }
bool—public Sandbox.SoundHandle.LipSyncAccessor Sandbox.SoundHandle.LipSync { get; set; }
Access lipsync processing.
public bool Sandbox.SoundHandle.ListenLocal { get; set; }
Place the listener at 0,0,0 facing 1,0,0.
bool—public Transform Sandbox.SoundHandle.LocalTransform { get; set; }
If we're following a parent, our position will be this relative to them.
public bool Sandbox.SoundHandle.Loopback { get; set; }
If true, then this sound won't be played unless voice_loopback is 1. The assumption is that it's the local user's voice. Amplitude and visme data will still be available!
bool—public string Sandbox.SoundHandle.Name { get; set; }
A debug name to help identify the sound
string—public bool Sandbox.SoundHandle.Occlusion { get; set; }
Legacy alias for `Sandbox.SoundHandle.OcclusionEnabled`.
Obsolete: Use OcclusionEnabled instead.
bool—public bool Sandbox.SoundHandle.OcclusionEnabled { get; set; }
Allow this sound to be occluded by geometry etc
bool—public float Sandbox.SoundHandle.OcclusionRadius { get; set; }
Legacy occlusion radius setting. No longer used by the simulation.
Obsolete: OcclusionRadius is no longer used by the simulation.
float—public Sandbox.GameObject Sandbox.SoundHandle.Parent { get; set; }
If set with a parent and is true, we will update our position to match the parent's world position. You can use to set an offset from the parent's position. Setting a parent also allows you to use GameObject.StopAllSounds on the parent to stop all sounds that are following it. This is set automatically when calling on a GameObject, but you can set it manually if you want to change the parent of an existing sound handle.
public bool Sandbox.SoundHandle.Paused { get; set; }
Whether the sound is currently paused or not.
bool—public float Sandbox.SoundHandle.Pitch { get; set; }
Pitch of the sound.
float—public Vector3 Sandbox.SoundHandle.Position { get; set; }
Position of the sound.
public bool Sandbox.SoundHandle.Reflections { get; set; }
Legacy alias for `Sandbox.SoundHandle.ReverbEnabled`.
Obsolete: Use ReverbEnabled instead.
bool—public float Sandbox.SoundHandle.Reverb { get; set; }
How much this sound contributes to room reverb. 1 = full reverb, 0 = completely dry.
float—public bool Sandbox.SoundHandle.ReverbEnabled { get; set; }
Enable reverb simulation for this sound (reflections/late reverb).
bool—public Rotation Sandbox.SoundHandle.Rotation { get; set; }
The direction the sound is facing
public int Sandbox.SoundHandle.SampleRate { get; set; }
How many samples per second?
int—public float Sandbox.SoundHandle.SpacialBlend { get; set; }
How 3d the sound should be. 0 means no 3d, 1 means fully
float—public Sandbox.Audio.Mixer Sandbox.SoundHandle.TargetMixer { get; set; }
Which mixer do we want to write to
public float Sandbox.SoundHandle.Time { get; set; }
The current time of the playing sound in seconds. Note: for some formats seeking may be expensive, and some may not support it at all.
float—public Transform Sandbox.SoundHandle.Transform { get; set; }
This sound's transform
public bool Sandbox.SoundHandle.Transmission { get; set; }
Legacy transmission toggle. Transmission is now derived from occlusion and material response.
bool—public float Sandbox.SoundHandle.Volume { get; set; }
Volume of the sound.
float—No results match this filter.