snd_create(STRING* filename)
Creates a SOUND object at runtime.
Objects created this way are automatically deleted on closing the engine, or by calling the ptr_remove function.
Parameters:
filename - .ogg or .wav sound file name, A7.82 or "#nnn" for creating a 440 Hz sine wave sound of nnn seconds duration (char* or STRING*).
Returns:
SOUND* pointer, or NULL if the file could not be opened.
Speed:
Slow
Example (lite-C):
SOUND* oggsound = snd_create("test.ogg");
// play the sound
var ogghandle = snd_play(oggsound,100,50);
// wait until finished
while (snd_playing(ogghandle)) { wait(1); }
// remove the sound
ptr_remove(oggsound);
See also:
SOUND,
snd_buffer, ptr_remove
► latest
version online