Audio Module
#audio.load audioResource audio.load(string filename)

Load a sound file and returns the audioResource if it has loaded successfully. Returns nil on failure.

#audio.unload audio.unload(audioResource resource)

Unloads an audio resource and sets its buffer & sources to empty (AL_NONE). resource)

Plays a loaded audio resource.

#audio.stop audio.stop(audioResource resource)

Stops an audioResource (if it is playing).

#audio.pause audio.pause(audioResource resource)

Pauses an audioResource (if it is playing).

#audio.getState string audio.getState(audioResource resource)

Returns the state of an audioResource as a string. The value will be one of the following: initial, playing, paused, stopped, unknown

#audio.setLooping audio.setLooping(audioResource resource, boolean looping)

Sets the "looping" state for an audioResource. If 'looping' is true, the resource will continue to replay until it is stopped.

#audio.setVolume audio.setVolume(audioResource resource, number volume)

Sets the volume for an audioResource. 0.0 = no volume, 1.0 = full volume.

Page last updated at 2018-09-25 20:46:59

Copyright 2021