Add audio¶
Play a sound from Lua¶
Or use the global Audio namespace:
Play music¶
Stop it with Audio.stopMusic("assets/music.mp3") or Audio.stopAllMusic().
Tips¶
- Sound effects are decoded into RAM and can overlap many times.
- Music is streamed from disk with one playhead per asset.
- Set
loop = truefor background tracks. shouldPlayis cleared byAudioSystemafter handling; set it once, not every frame.- Bundled ids are relative file names (
laser.wav, notassets/laser.wav).
See Engine → Audio and Lua → Audio.