sound_add(fname,kind,preload)

From ENIGMA
Jump to navigation Jump to search

Description

Adds a new sound and loads its data from the given path.

Parameters

Parameter Data Type Description
fname string file name and path to the file to load the sound from
kind integer 0, for normal, 1 for background music
preload boolean whether or not to load the sound immediately or the first time it is played

Return Values

integer: Returns the index of the loaded sound.

Example Call

// example of loading a sound from a file
snd_gunshot = sound_add("gunshot.wav", 0, 1);
sound_play(snd_gunshot);