Sound_Player module

load_audio_data

procedureSource

Reads a sound from memory. The result has loaded set when it worked.

Example
sound := load_audio_data("junk", "this is not audio");
assert(!sound.loaded);

Doesn't run in the browser (skipped on wasm).

load_audio_data :: (
    name_for_error_reporting: string,
    data: string
) -> Sound_Data

Reads a sound from memory. The result has loaded set when it worked.

Parameters

name_for_error_reporting: string
shown when the data cannot be read, and kept as the sound's name.
data: string
the bytes of a WAV or Ogg Vorbis file. They are not copied, so they must stay alive as long as the sound is used.

Returns

Example
sound := load_audio_data("junk", "this is not audio");
assert(!sound.loaded);

Doesn't run in the browser (skipped on wasm).

See also