API ReferenceSandbox.Audio

Mixerclass

Takes a bunch of sound, changes its volumes, mixes it together, outputs it

objectMixer
Namespace
Sandbox.Audio
Assembly
Sandbox.Engine
Declaration
public class Sandbox.Audio.Mixer

Methods20

Showing 20 methods

public Sandbox.Audio.Mixer AddChild()PUBLIC

Returns:Mixer

public void ClearProcessors()PUBLIC

Returns:void

public void Deserialize(System.Text.Json.Nodes.JsonObject js, Sandbox.Internal.TypeLibrary typeLibrary)PUBLIC

ParameterTypeDescription
jsJsonObject
typeLibraryTypeLibrary
Returns:void

public void Destroy()PUBLIC

Returns:void

public static Sandbox.Audio.Mixer FindMixerByGuid(System.Guid guid)PUBLICSTATIC

ParameterTypeDescription
guidGuid
Returns:Mixer

public static Sandbox.Audio.Mixer FindMixerByName(string name)PUBLICSTATIC

ParameterTypeDescription
namestring
Returns:Mixer

public Sandbox.TagSet GetBlockingTags()PUBLIC

Walks the parent chain. If either local tag set is non-empty, returns this mixer's `Sandbox.Audio.Mixer.BlockingTags`; otherwise inherits from parent. Resolved together with `Sandbox.Audio.Mixer.GetIgnoredTags` to avoid split-brain.

Returns:TagSet

public Sandbox.Audio.Mixer[] GetChildren()PUBLIC

Returns:Mixer[]

public Sandbox.TagSet GetIgnoredTags()PUBLIC

Walks the parent chain. See `Sandbox.Audio.Mixer.GetBlockingTags` for inheritance rules.

Returns:TagSet

public System.Collections.Generic.IReadOnlySet`1<uint> GetOcclusionTags()PUBLICOBSOLETE

Get an array of occlusion tags our sounds want to hit. May return null if there are none defined!

Obsolete: Use GetBlockingTags() instead.

Returns:IReadOnlySet<uint>

public T GetProcessor()PUBLIC

Returns:T

public bool IsDescendantOf(Sandbox.Audio.Mixer mixer)PUBLIC

Returns true if this mixer is a descendant of the given mixer.

ParameterTypeDescription
mixerMixer
Returns:bool

public static void ResetToDefault()PUBLICSTATIC

Returns:void

public System.Text.Json.Nodes.JsonObject Serialize()PUBLIC

Returns:JsonObject

protected void SetMasterOcclusionDefaults()PROTECTED

Returns:void

protected void SetMasterSimulationTagDefaults()PROTECTED

Returns:void

public void StopAll(float fade)PUBLIC

Stop all sound handles using this mixer

ParameterTypeDescription
fadefloat
Returns:void

Properties23

Showing 23 properties

public float Sandbox.Audio.Mixer.AirAbsorption { get; set; }PUBLICGETSET

How much the air absorbs energy from the sound

Returns:float

public Sandbox.TagSet Sandbox.Audio.Mixer.BlockingTags { get; set; }PUBLICGETSET

If non-empty, audio simulation traces (occlusion, transmission, reverb rays) only register hits on bodies with one of these tags. Empty = hit everything that isn't in `Sandbox.Audio.Mixer.IgnoredTags`.

Returns:TagSet

public int Sandbox.Audio.Mixer.ChildCount { get; set; }PUBLICGETSET

Returns:int

public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Default { get; set; }PUBLICSTATICGETSET

Returns:Mixer

public float Sandbox.Audio.Mixer.DistanceAttenuation { get; set; }PUBLICGETSET

Sounds get quieter as they go further away

Returns:float

public System.Guid Sandbox.Audio.Mixer.Id { get; set; }PUBLICGETSET

Unique identifier for this object, for lookup, deserialization etc

Returns:Guid

public Sandbox.TagSet Sandbox.Audio.Mixer.IgnoredTags { get; set; }PUBLICGETSET

Audio simulation traces always skip bodies with these tags (e.g. triggers, sky, passaudio). Applied on top of `Sandbox.Audio.Mixer.BlockingTags`.

Returns:TagSet

public bool Sandbox.Audio.Mixer.IsMaster { get; set; }PUBLICGETSET

The default mixer gets all sounds that don't have a mixer specifically assigned

Returns:bool

public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Master { get; set; }PUBLICSTATICGETSET

Returns:Mixer

public int Sandbox.Audio.Mixer.MaxVoices { get; set; }PUBLICGETSET

The maximum amount of voices to play at one time on this mixer

Returns:int

public Sandbox.Audio.AudioMeter Sandbox.Audio.Mixer.Meter { get; set; }PUBLICGETSET

Allows monitoring of the output of the mixer

Returns:AudioMeter

public bool Sandbox.Audio.Mixer.Mute { get; set; }PUBLICGETSET

Is this mixer muted?

Returns:bool

public string Sandbox.Audio.Mixer.Name { get; set; }PUBLICGETSET

The display name for this mixer

Returns:string

public float Sandbox.Audio.Mixer.Occlusion { get; set; }PUBLICGETSET

How much these sounds can get occluded (0 = no occlusion simulation, 1 = full).

Returns:float

public Sandbox.TagSet Sandbox.Audio.Mixer.OcclusionTags { get; set; }PUBLICGETSETOBSOLETE

The tags which occlude our physics.

Obsolete: Use BlockingTags instead.

Returns:TagSet

public bool Sandbox.Audio.Mixer.OverrideOcclusion { get; set; }PUBLICGETSETOBSOLETE

If true then this mixer will use custom occlusion tags. If false we'll use what our parent uses.

Obsolete: Use OverrideOcclusion + BlockingTags / IgnoredTags instead.

Returns:bool

public int Sandbox.Audio.Mixer.ProcessorCount { get; set; }PUBLICGETSET

Returns:int

public float Sandbox.Audio.Mixer.Reverb { get; set; }PUBLICGETSET

How much reverb is applied to sounds routed through this mixer (0 = dry / disabled, 1 = full).

Returns:float

public bool Sandbox.Audio.Mixer.Solo { get; set; }PUBLICGETSET

Should this be the only mixer that is heard?

Returns:bool

public float Sandbox.Audio.Mixer.Spacializing { get; set; }PUBLICGETSETOBSOLETE

Legacy misspelled alias for `Sandbox.Audio.Mixer.Spatializing`.

Obsolete: Use Spatializing instead.

Returns:float

public float Sandbox.Audio.Mixer.Spatializing { get; set; }PUBLICGETSET

When 0 the sound will come out of all speakers, when 1 it will be fully spatialized

Returns:float

public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Voice { get; set; }PUBLICSTATICGETSET

Returns:Mixer

public float Sandbox.Audio.Mixer.Volume { get; set; }PUBLICGETSET

Scale the volume of our output by this amount

Returns:float

On this page

Methodspublic Sandbox.Audio.Mixer AddChild()public System.Void AddProcessor(Sandbox.Audio.AudioProcessor ap)public System.Void ClearProcessors()public System.Void Deserialize(System.Text.Json.Nodes.JsonObject js, Sandbox.Internal.TypeLibrary typeLibrary)public System.Void Destroy()public static Sandbox.Audio.Mixer FindMixerByGuid(System.Guid guid)public static Sandbox.Audio.Mixer FindMixerByName(System.String name)public Sandbox.TagSet GetBlockingTags()public Sandbox.Audio.Mixer[] GetChildren()public Sandbox.TagSet GetIgnoredTags()public System.Collections.Generic.IReadOnlySet`1<System.UInt32> GetOcclusionTags()public T GetProcessor()public Sandbox.Audio.AudioProcessor[] GetProcessors()public System.Boolean IsDescendantOf(Sandbox.Audio.Mixer mixer)public System.Void RemoveProcessor(Sandbox.Audio.AudioProcessor ap)public static System.Void ResetToDefault()public System.Text.Json.Nodes.JsonObject Serialize()protected System.Void SetMasterOcclusionDefaults()protected System.Void SetMasterSimulationTagDefaults()public System.Void StopAll(System.Single fade)Propertiespublic System.Single Sandbox.Audio.Mixer.AirAbsorption { get; set; }public Sandbox.TagSet Sandbox.Audio.Mixer.BlockingTags { get; set; }public System.Int32 Sandbox.Audio.Mixer.ChildCount { get; set; }public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Default { get; set; }public System.Single Sandbox.Audio.Mixer.DistanceAttenuation { get; set; }public System.Guid Sandbox.Audio.Mixer.Id { get; set; }public Sandbox.TagSet Sandbox.Audio.Mixer.IgnoredTags { get; set; }public System.Boolean Sandbox.Audio.Mixer.IsMaster { get; set; }public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Master { get; set; }public System.Int32 Sandbox.Audio.Mixer.MaxVoices { get; set; }public Sandbox.Audio.AudioMeter Sandbox.Audio.Mixer.Meter { get; set; }public System.Boolean Sandbox.Audio.Mixer.Mute { get; set; }public System.String Sandbox.Audio.Mixer.Name { get; set; }public System.Single Sandbox.Audio.Mixer.Occlusion { get; set; }public Sandbox.TagSet Sandbox.Audio.Mixer.OcclusionTags { get; set; }public System.Boolean Sandbox.Audio.Mixer.OverrideOcclusion { get; set; }public System.Int32 Sandbox.Audio.Mixer.ProcessorCount { get; set; }public System.Single Sandbox.Audio.Mixer.Reverb { get; set; }public System.Boolean Sandbox.Audio.Mixer.Solo { get; set; }public System.Single Sandbox.Audio.Mixer.Spacializing { get; set; }public System.Single Sandbox.Audio.Mixer.Spatializing { get; set; }public static Sandbox.Audio.Mixer Sandbox.Audio.Mixer.Voice { get; set; }public System.Single Sandbox.Audio.Mixer.Volume { get; set; }Metadata