snd_play (
SOUND*, var Volume, var Balance);
snd_loop
(
SOUND*, var Volume, var Balance);
Snd_play
plays a previously defined SOUND with
the volume given (0..100).
Snd_loop plays the sound endlessly until it is stopped
explicitly. The instruction returns a handle number
which allows further manipulation or prematurely stopping the sound. The handle
is valid as long as this sound plays. Use var_nsave
for storing handles to prevent them from being overwritten with invalid values
by a load instruction. The balance
parameter gives the stereo position of the sound in percent (-100 .. +100).
You can create an echo effect by playing the same sound twice, with a short
delay in-between. Up to 32 sounds may be played simultaneously.Parameters:
|
SOUND* |
Sound pointer |
| Volume |
volume (0..100). |
| Balance |
stereo balance (-100 .. +100). Negative values turns the sound to the left, positiv to the right speaker.. |
Returns:
Sound handle.
Speed:
SlowExample:
SOUND* whamm = "whamm.wav";
var whamm_handle;
...
whamm_handle = snd_play(whamm, 100, 0);
See also:
ent_playsound, snd_stop, snd_tune,
snd_playing