Skip to content
Download

Sounds and music

Drag the file (WAV, OGG or MP3) into Resources. The sound name is the file name, without the extension.

Audio.play("explosao")
Audio.play("tiro", { volume = 0.4 })
Audio.playMusic("tema", 0.6)
Audio.setMusicVolume(0.3)
Audio.stopMusic()
  • Audio.play returns immediately; several effects play at the same time.
  • Only one music track plays at a time, looping. Playing another replaces the current one.
  • A looping effect: loop = true, stopped later with Audio.stop(id).
  • Copy code, in the sound Inspector, copies the ready line.

Reference: Sound.