reference monoe.audio

Lua API Reference

Represents an audio player capable of loading, playing, and managing sound files.

Properties

NameTypeDescription
uidintegerUnique engine-side identifier for the audio object

monoe.audio.new

Creates a new `monoe.audio` object. If a `source` is provided, the audio file will be loaded automatically.

Parameters

NameTypeDescription
sourcestring? Optional file path to load immediately

Returns


monoe.audio:load

Loads a sound file (.wav, .mp3) into the audio player.

Parameters

NameTypeDescription
sourcestringFile path of the audio to load

monoe.audio:play

Plays the audio.

Parameters

NameTypeDescription
atnumber? Optional starting position in seconds
loopboolean? Whether the audio should loop (default: false)

monoe.audio:stop

Stops playback of the audio.


monoe.audio:length

Returns the length of the audio stream in seconds.

Returns


monoe.audio:finished

Returns the name of the event triggered when playback finishes.

Returns


monoe.audio:free

Frees the engine-side resources associated with this audio object.


monoe.audio:remove

Removes the instance from the rendering side.