QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Output sound is mixed from an number of active sound channels. More...

Macros

#define MAX_CHANNELS   512
 number of available mixing channels More...
 
#define MAX_DYNAMIC_CHANNELS   128
 number of dynamic channels More...
 
#define MAX_STATIC_CHANNELS   256
 number of static channels More...
 

Functions

struct channel_sSND_AllocChannel (void)
 Allocate a sound channel that can be used for playing sounds. More...
 
void SND_AmbientOff (void)
 Disable ambient sounds. More...
 
void SND_AmbientOn (void)
 Enable ambient sounds. More...
 
void SND_Channels_Init (void)
 Initialize the channels sub-subsystem. More...
 
void SND_ChannelStop (channel_t *chan)
 Stop a channel from playing. More...
 
void SND_LocalSound (const char *s)
 Start a sound local to the client view. More...
 
void SND_ScanChannels (int wait)
 Scan channels looking for stopped channels. More...
 
void SND_SetListener (const vec3_t origin, const vec3_t v_forward, const vec3_t v_right, const vec3_t v_up, const byte *ambient_sound_level)
 Update the sound engine with the client's position and orientation and render some sound. More...
 
void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, float fvol, float attenuation)
 Start a sound playing. More...
 
void SND_StaticSound (sfx_t *sfx, const vec3_t origin, float vol, float attenuation)
 Create a sound generated by the world. More...
 
void SND_StopAllSounds (void)
 Stop all sounds from playing. More...
 
void SND_StopSound (int entnum, int entchannel)
 Stop an entity's sound. More...
 

Variables

channel_t snd_channels [MAX_CHANNELS]
 pool of available channels More...
 
int snd_total_channels
 number of active channels More...
 

Detailed Description

Output sound is mixed from an number of active sound channels.

Macro Definition Documentation

#define MAX_CHANNELS   512

number of available mixing channels

#define MAX_DYNAMIC_CHANNELS   128

number of dynamic channels

#define MAX_STATIC_CHANNELS   256

number of static channels

Function Documentation

struct channel_s* SND_AllocChannel ( void  )

Allocate a sound channel that can be used for playing sounds.

void SND_AmbientOff ( void  )

Disable ambient sounds.

Todo:
not used, remove?
void SND_AmbientOn ( void  )

Enable ambient sounds.

Todo:
not used, remove?
void SND_Channels_Init ( void  )

Initialize the channels sub-subsystem.

void SND_ChannelStop ( channel_t chan)

Stop a channel from playing.

Parameters
chanthe channel to stop
void SND_LocalSound ( const char *  s)

Start a sound local to the client view.

Parameters
sname of sound to play
void SND_ScanChannels ( int  wait)

Scan channels looking for stopped channels.

Parameters
waitif true, wait for the channels to be done. if false, force the channels to be done. true is for threaded, false for non-threaded.
void SND_SetListener ( const vec3_t  origin,
const vec3_t  v_forward,
const vec3_t  v_right,
const vec3_t  v_up,
const byte ambient_sound_level 
)

Update the sound engine with the client's position and orientation and render some sound.

Parameters
origin3d coords of the client
v_forward3d vector of the client's facing direction
v_right3d vector of the client's rightward direction
v_up3d vector of the client's upward direction
ambient_sound_levelPointer to 4 bytes indicating the levels at which to play the ambient sounds.
void SND_StartSound ( int  entnum,
int  entchannel,
sfx_t sfx,
const vec3_t  origin,
float  fvol,
float  attenuation 
)

Start a sound playing.

Parameters
entnumindex of entity the sound is associated with.
entchannel0-7
  • 0 auto (never willingly overrides)
  • 1 weapon
  • 2 voice
  • 3 item
  • 4 body
sfxsound to play
origin3d coords of where the sound originates
fvolabsolute volume of the sound
attenuationrate of volume dropoff vs distance
void SND_StaticSound ( sfx_t sfx,
const vec3_t  origin,
float  vol,
float  attenuation 
)

Create a sound generated by the world.

Parameters
sfxsound to play
origin3d coords of where the sound originates
volabsolute volume of the sound
attenuationrate of volume dropoff vs distance
void SND_StopAllSounds ( void  )

Stop all sounds from playing.

void SND_StopSound ( int  entnum,
int  entchannel 
)

Stop an entity's sound.

Parameters
entnumindex of entity the sound is associated with.
entchannelchannel to silence

Variable Documentation

channel_t snd_channels[MAX_CHANNELS]

pool of available channels

int snd_total_channels

number of active channels