SOUND* name = "filename";
Defines a sound in .wav or .ogg format
with the given name. Sample rates of 11, 22, or 44 kHz and 8 or 16 bit
mono are supported.
Parameters:
"filename" - name of the .wav or .ogg sound
file,
A7.82 or "#nnn" for creating a 440 Hz sine wave sound of nnn seconds duration.
Remarks:
- Defined sounds are permanently stored in memory and can be played or looped
without initial delay. For large sounds
to be streamed from a file, sounds in other formats (such as .mp3) and
stereo sounds use the media_play function.
-
Use snd_create() for creating a sound at runtime.
-
Sine wave sounds created with "#nnn" don't require a sound file, and can be used as sound buffers for further manipulation with the snd_tune or snd_buffer functions.
Example:
SOUND* explo_snd = "explo.wav";
...
snd_play(explo_snd,100,0);
See also:
snd_create, snd_buffer, snd_play, media_play
► latest
version online