Audio track name (case-sensitive).
OptionalvolumeOrOptions: number | TrackOptions
Playback volume, 0.0..1.0 (defaults to the
current global volume), or a TrackOptions object with volume
and the sprite region to loop on.
The sound instance ID.
Play the specified audio track, replacing whatever track was playing.
The clip loops, and its name becomes the current track for stopTrack / pauseTrack / resumeTrack / getCurrentTrack. The previous track is stopped first, so only one track is ever playing: there is a single current-track slot, and a track left running after the slot had moved on could no longer be reached by any of those four.
Calling it with the name already playing restarts that track from the beginning, the same as play on any other clip. Scene code that wants the bed to carry on across a screen change should not call this again, rather than rely on it doing nothing.
Use play for sound effects: they are meant to overlap, and nothing here applies to them. The track can be one region of the clip, from its
spritemap. An MP3 encoder pads the end of its file and Safari plays the padding, so a looping MP3 drops out for a moment at each loop there: a region of the loop's exact length keeps it gapless.