Lua Class - audioEmitter

Extends sceneObject

audioEmitter is a class that contains 7 properties, 3 methods and 0 events. This class extends sceneObject.

CODE SAMPLE
--The values set in this constructor are random and may not work correctly.
local audioEmitter = teverse.construct("audioEmitter", {
    gain = 1.0,
    loop = true,
    maxDistance = 1.0,
    name = "",
    offset = 1.0,
    pitch = 1.0,
    position = vector3(10, 10, 10),
    rolloffFactor = 1.0,
    rotation = quaternion,
    track = ""
})
Properties
number gain

Controls the loudness of the audio

CODE SAMPLE
audioEmitter.gain = 1.0
print(audioEmitter.gain) --> 1.0
boolean loop

When true, the audio is repeated until manually stopped

CODE SAMPLE
audioEmitter.loop = true
print(audioEmitter.loop) --> true
number maxDistance

Audio will not be audible beyond this distance in 3D Space

CODE SAMPLE
audioEmitter.maxDistance = 1.0
print(audioEmitter.maxDistance) --> 1.0
number offset

The offset of the track in seconds

CODE SAMPLE
audioEmitter.offset = 1.0
print(audioEmitter.offset) --> 1.0
number pitch

CODE SAMPLE
audioEmitter.pitch = 1.0
print(audioEmitter.pitch) --> 1.0
number rolloffFactor

Rolloff rate for the source, default is 1.0

CODE SAMPLE
audioEmitter.rolloffFactor = 1.0
print(audioEmitter.rolloffFactor) --> 1.0
string track

The loaded track

CODE SAMPLE
audioEmitter.track = ""
print(audioEmitter.track) --> ""
INHERITED READONLY
vector3 absolutePosition

CODE SAMPLE
print(audioEmitter.absolutePosition) --> vector3(10, 10, 10)
INHERITED READONLY
quaternion absoluteRotation

CODE SAMPLE
print(audioEmitter.absoluteRotation) --> quaternion
INHERITED READONLY
number id

CODE SAMPLE
print(audioEmitter.id) --> 1.0
INHERITED
string name

CODE SAMPLE
audioEmitter.name = ""
print(audioEmitter.name) --> ""
INHERITED
vector3 position

CODE SAMPLE
audioEmitter.position = vector3(10, 10, 10)
print(audioEmitter.position) --> vector3(10, 10, 10)
INHERITED
quaternion rotation

CODE SAMPLE
audioEmitter.rotation = quaternion
print(audioEmitter.rotation) --> quaternion
Methods
pause( )

Pauses a playing track

CODE SAMPLE
audioEmitter:pause() --> 
play( )

Plays the loaded track

CODE SAMPLE
audioEmitter:play() --> 
stop( )

Stops a playing track

CODE SAMPLE
audioEmitter:stop() --> 
INHERITED
destroy( )
CODE SAMPLE
audioEmitter:destroy() --> 

Destroys this object, further accessing this instance will error

Events

Some sections of our docs are maintained on github.