Skip to main content

Sound

Sound Methods, supporting WAV, OGG and ADPCM.

Methods​

setVolume​

Sound.setVolume(volume, slot?);

*If slot is specified, it will change ADPCM slot volume, else it will change master volume.

load​

const audio = Sound.load(path);

play​

Sound.play(audio, slot?);

*ADPCM: If slot isn't specified, it will use 0.

free​

Sound.free(audio);

isPlaying​

const playing = Sound.isPlaying();

*Doesn't apply for ADPCM

duration​

const msec = Sound.duration();

repeat​

Sound.repeat(false);

*Doesn't apply for ADPCM

pause​

Sound.pause(audio);

*Doesn't apply for ADPCM

resume​

Sound.resume(audio);

*Doesn't apply for ADPCM

deinit​

Sound.deinit();