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

Difference between revisions of "sound"

From Quake Wiki

(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:===...")
 
Line 4: Line 4:
 
This function is used for playing a sound.
 
This function is used for playing a sound.
 
====Parameters:====
 
====Parameters:====
:<code>channel</code> - (integer) The channel to play the sound on.  A sound played on the same channel as another will override the previous one.
+
:<code>channel</code> - The channel to play the sound on.  A sound played on the same channel as another will override the previous one.  Use integer values only.
:<code>sample</code> - (string) The path to the sound file.  Unlike models, sounds have /sound/ already present, so do not include that directory in the pathname.
+
:<code>sample</code> - The path to the sound file.  Unlike models, sounds have /sound/ already present, so do not include that directory in the pathname.
:<code>volume</code> - (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.
+
:<code>volume</code> - A value between 0.0 and 1.0 that controls the volume of the sound.  0.0 is silent, 1.0 is full volume.
:<code>attenuation</code> - (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.
+
:<code>attenuation</code> - 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:====
 
====Returns:====
 
:void
 
:void
  
 
[[Category:QuakeC Function]]
 
[[Category:QuakeC Function]]

Revision as of 00:57, 25 March 2013

Syntax:

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

This function is used for playing a sound.

Parameters:

channel - The channel to play the sound on. A sound played on the same channel as another will override the previous one. Use integer values only.
sample - The path to the sound file. Unlike models, sounds have /sound/ already present, so do not include that directory in the pathname.
volume - 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 - 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