Audio clip name (case-sensitive).
Whether to loop the clip (defaults to false), or a
PlayOptions object. The object form is the only way to name a
sprite region; the boolean form is unchanged.
Optionalonend: (() => void) | null
Called when the sound instance ends playing.
Optionalvolume: number
Playback volume, 0.0..1.0. Defaults to the current
global volume.
The sound instance ID.
// play the "cling" audio clip
me.audio.play("cling");
// play & loop the "engine" audio clip
me.audio.play("engine", true);
// play the "gameover_sfx" audio clip and call myFunc when finished
me.audio.play("gameover_sfx", false, myFunc);
// play the "gameover_sfx" audio clip at half volume
me.audio.play("gameover_sfx", false, null, 0.5);
// play a named region of a sprite sheet, at half volume
me.audio.play("sfx", { sprite: "jump", volume: 0.5 });
Play the specified sound.