Reads a sound file. The result has loaded set when it worked.
- filename: a WAV or Ogg Vorbis file.
- optional: true when a missing file is fine, so it is not reported as an error.
sound := load_audio_file("music.ogg");
if !sound.loaded return;This one is only checked to compile, not run.
load_audio_file :: (filename: string, optional := false) -> Sound_Data
Reads a sound file. The result has loaded set when it worked.
Parameters
- filename: string
- a WAV or Ogg Vorbis file.
- optional := false
- true when a missing file is fine, so it is not reported as an error.
Returns
sound := load_audio_file("music.ogg");
if !sound.loaded return;This one is only checked to compile, not run.