Skip to content

AudioSound

Extends EngineObject.

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

Properties

  • path: string Read-only.
  • is3_d: boolean Read-only.
  • min_distance: number 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.
  • max_distance: number The distance in meters beyond which the sound gets no quieter: 10000. Voices of this sound start with it.
  • length: number The length in seconds (0 when the file does not say). Read-only.

Methods

play

function play(self, bus: string?, volume: number?, pitch: number?, loop: boolean?, entity: Entity?): AudioVoice

Plays it on bus (see AudioSystem.GetBus; 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.