API Reference › Audio › Audio.load
method

Audio.load

Audio.load(path) -> int

Loads a sound file and returns a handle (>= 1), or 0 on failure or in a headless build. Load each sound once (e.g. during the Start phase) and reuse the handle.

Example

program Demo {
  entry {
    let sfx = Audio.load("blip.wav")
    print(sfx)
  }
}
← All symbols