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("explosao");Audio::play("tiro", {.volume = 0.4f});
Audio::playMusic("tema", 0.6f);Audio::setMusicVolume(0.3f);Audio::stopMusic();Audio.playreturns 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 withAudio.stop(id). - Copy code, in the sound Inspector, copies the ready line.
Reference: Sound.
