Skip to content

Class AudioSound

Namespace: Apogee.Audio
Assembly: Apogee.Audio.dll

A sound file loaded by : play it any number of times, on any bus.

public sealed class AudioSound : EngineObject

Inheritance

object ← EngineObject ← AudioSound

Inherited Members

EngineObject.IsAdopted, EngineObject.Handle, EngineObject.IsDestroyed, EngineObject.Class, EngineObject.Adopt(), EngineObject.TryGet(SlotHandle, out EngineObject), EngineObject.Destroy(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

Class

What the registry knows about this object's class.

public override ClassInfo Class { get; }

Property Value

ClassInfo

Is3D

public bool Is3D { get; }

Property Value

bool

Length

The length in seconds (0 when the file does not say).

public float Length { get; }

Property Value

float

MaxDistance

The distance in meters beyond which the sound gets no quieter: 10000. Voices of this sound start with it.

public float MaxDistance { get; set; }

Property Value

float

MinDistance

The distance in meters up to which the sound is not made quieter (inverse-distance rolloff starts here): 1. Voices of this sound start with it.

public float MinDistance { get; set; }

Property Value

float

Path

public string Path { get; }

Property Value

string

Methods

OnDestroyed()

protected override void OnDestroyed()

Play(string, float, float, bool, Entity)

Plays it on bus (see ; empty is the master mix), at this volume and pitch, looping if asked (or if it was loaded with loop), following entity if given. Returns the voice.

public AudioVoice Play(string bus = "", float volume = 1, float pitch = 1, bool loop = false, Entity entity = default)

Parameters

bus string

volume float

pitch float

loop bool

entity Entity

Returns

AudioVoice