Skip to content

AudioVoice

Extends EngineObject.

Something that is playing, or about to: a sound on a source (AudioSound.Play). 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.

Properties

  • entity: Entity The entity the voice follows in 3D, or 0 for a voice that is not positional (or sits at the listener).
  • occlusion: boolean Check the way from the listener with the physics world's rays and muffle the sound behind walls (smoothly): needs AudioSystem.Physics and an Entity.
  • volume: number
  • pitch: number Playback speed and pitch together: 1 is as recorded, 2 an octave up.
  • min_distance: number The distance in meters up to which the voice is not made quieter.
  • max_distance: number The distance in meters beyond which the voice gets no quieter.
  • paused: boolean
  • is_playing: boolean Whether it is still sounding (a paused sound is). Read-only.
  • position: number The playback position in seconds. Read-only.
  • muffling: number How much the sound is muffled by what is between it and the listener, 0 (nothing) to 1. Read-only.

Methods

stop

function stop(self): ()

Stops it at once.