Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

sound

From Quake Wiki

Revision as of 00:49, 25 March 2013 by Necros (talk | contribs) (Created page with "====Syntax:==== <code>void sound(entity e, float channel, string sample, float volume, float attenuation)</code> This function is used for playing a sound. ====Parameters:===...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Syntax:

void sound(entity e, float channel, string sample, float volume, float attenuation)

This function is used for playing a sound.

Parameters:

channel - (integer) The channel to play the sound on. A sound played on the same channel as another will override the previous one.
sample - (string) The path to the sound file. Unlike models, sounds have /sound/ already present, so do not include that directory in the pathname.
volume - (float) A value between 0.0 and 1.0 that controls the volume of the sound. 0.0 is silent, 1.0 is full volume.
attenuation - (float) A value greater than or equal to 0 and less than 4 that controls how fast the sound's volume attenuated from distance. 0 can be heard everywhere in the level and 3.999 has a radius of about 250 units.

Returns:

void