snd_create(STRING* filename): SOUND*

snd_createoal(STRING* filename): SOUND*      C  A8.22

Creates a DirectSound resp. OpenAL sound object. Objects created this way are automatically deleted on closing the engine, or by calling the ptr_remove function.

snd_createstream(STRING* filename): SOUND*      C  A8.22

Creates an OpenAL sound object for stream playing from an .ogg sound file.

Parameters:

filename - .ogg or .wav sound file name, or "#nnn" for a 440 Hz sine wave sound of nnn seconds duration (char* or STRING*).

Returns:

SOUND* pointer, or NULL if the sound could not be created.

Speed:

Slow

Remarks about OpenAL sounds:

Remarks:

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