Skip to content

Class AudioVoice

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

Something that is playing, or about to: a sound on a source (). Attach it to an entity to make it positional: it then follows that entity's world transform, with the velocity for Doppler, and is set relative to the nearest listener in double precision. A voice from an inactive audio system (no OpenAL) is inert: it never plays.

public sealed class AudioVoice : EngineObject

Inheritance

object ← EngineObject ← AudioVoice

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()

Remarks

Letting go of the voice: a sound that does not loop plays on to its end; a looping sound is stopped when its voice is destroyed, which a script's voice is when the script drops it. Keep the voice of something that loops.

Properties

Class

What the registry knows about this object's class.

public override ClassInfo Class { get; }

Property Value

ClassInfo

Entity

The entity the voice follows in 3D, or 0 for a voice that is not positional (or sits at the listener).

public Entity Entity { get; set; }

Property Value

Entity

IsPlaying

Whether it is still sounding (a paused sound is).

public bool IsPlaying { get; }

Property Value

bool

MaxDistance

The distance in meters beyond which the voice gets no quieter.

public float MaxDistance { get; set; }

Property Value

float

MinDistance

The distance in meters up to which the voice is not made quieter.

public float MinDistance { get; set; }

Property Value

float

Muffling

How much the sound is muffled by what is between it and the listener, 0 (nothing) to 1.

public float Muffling { get; }

Property Value

float

Occlusion

Check the way from the listener with the physics world's rays and muffle the sound behind walls (smoothly): needs and an .

public bool Occlusion { get; set; }

Property Value

bool

Paused

public bool Paused { get; set; }

Property Value

bool

Pitch

Playback speed and pitch together: 1 is as recorded, 2 an octave up.

public float Pitch { get; set; }

Property Value

float

Position

The playback position in seconds.

public float Position { get; }

Property Value

float

Volume

public float Volume { get; set; }

Property Value

float

Methods

OnDestroyed()

protected override void OnDestroyed()

Stop()

Stops it at once.

public void Stop()