ent_playsound (
ENTITY*, SOUND*, var
volume);
Plays a 3D sound at the position of the given entity.
ent_playloop (
ENTITY*, SOUND*, var volume);
Plays
a 3D sound in an endless loop until it is stopped explicitly.
The sound source moves together with the entity.
Parameter:
|
ENTITY* |
Entity pointer. |
|
SOUND* |
Sound pointer. |
| volume |
volume in percent, and range in 10 quant units (0..1000). |
Returns:
Sound handle.Remarks:
-
The range (in quants) of a 3D entity sound is 10 times its volume. The volume may be set at up to 1000 to give a huge range; the sound itself, of course, is not played louder than with volume 100.
- The entity must already exist at the time the sound is played.
The sound can be played 1 frame cycle after entity creation, the earliest.
-
The sound will use the sound card's stereo and 3D capabilities, and plays with Doppler effect depending on the entities' position and
it's speed (adjustable with doppler_factor).
- The sound volume and frequency can the tuned with snd_tune().
The sound status can be checked with snd_playing().
- Up to 32 3D sounds can be played simultaneously; if more are played,
the sounds farthest away from the camera are stopped.
Example:
SOUND* whosh = "whosh.wav";
var whosh_handle;
...
whosh_handle = ent_playloop(my,whosh,100);
See also:
snd_play, snd_stop,
snd_tune, snd_playing,
doppler_factor
► latest
version online