FTEQW
Documentation of the FTE engine source tree.
sound.h File Reference

Go to the source code of this file.

Classes

struct  sfxdecode_t
 
struct  sfx_s
 
struct  sfxcache_s
 
struct  dma_t
 
struct  channel_t
 
struct  sndreverbproperties_s
 
struct  sndreverbproperties_s::reverbproperties_s
 
struct  sounddriver_t
 
struct  soundcardinfo_s
 
struct  snd_capture_driver_t
 

Typedefs

typedef struct sfx_s sfx_t
 
typedef struct sfxcache_s sfxcache_t
 
typedef struct soundcardinfo_s soundcardinfo_t
 
typedef qboolean(QDECL * S_LoadSound_t) (sfx_t *s, qbyte *data, size_t datalen, int sndspeed, qboolean forcedecode)
 

Enumerations

enum  { SLS_NOTLOADED , SLS_LOADING , SLS_LOADED , SLS_FAILED }
 
enum  qaudiofmt_t { QAF_BLOB =0 , QAF_S8 =1 , QAF_S16 =2 , QAF_F32 =0x80|4 }
 
enum  chanupdatereason_t {
  CUR_SPACIALISEONLY = 0 , CUR_UPDATE = (1u<<1) , CUR_SOUNDCHANGE = (1u<<2) , CUR_OFFSET = (1u<<3) ,
  CUR_EVERYTHING = CUR_UPDATE|CUR_SOUNDCHANGE|CUR_OFFSET
}
 

Functions

void S_Init (void)
 
void S_Startup (void)
 
void S_EnumerateDevices (void)
 
void S_Shutdown (qboolean final)
 
float S_GetSoundTime (int entnum, int entchannel)
 
float S_GetChannelLevel (int entnum, int entchannel)
 
void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, vec3_t velocity, float fvol, float attenuation, float timeofs, float pitchadj, unsigned int flags)
 
float S_UpdateSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, vec3_t velocity, float fvol, float attenuation, float timeofs, float pitchadj, unsigned int flags)
 
void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
 
void S_StopSound (int entnum, int entchannel)
 
void S_StopAllSounds (qboolean clear)
 
void S_UpdateListener (int seat, int entnum, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, size_t reverbtype, vec3_t velocity)
 
qboolean S_UpdateReverb (size_t reverbtype, void *reverb, size_t reverbsize)
 
void S_GetListenerInfo (int seat, float *origin, float *forward, float *right, float *up)
 
void S_Update (void)
 
void S_ExtraUpdate (void)
 
void S_MixerThread (soundcardinfo_t *sc)
 
void S_Purge (qboolean retaintouched)
 
void S_LockMixer (void)
 
void S_UnlockMixer (void)
 
qboolean S_HaveOutput (void)
 
void S_Music_Clear (sfx_t *onlyifsample)
 
void S_Music_Seek (float time)
 
qboolean S_GetMusicInfo (int musicchannel, float *time, float *duration, char *title, size_t titlesize)
 
qboolean S_Music_Playing (int musicchannel)
 
float Media_CrossFade (int musicchanel, float vol, float time)
 
sfx_tMedia_NextTrack (int musicchanel, float *time)
 
sfx_tS_FindName (const char *name, qboolean create, qboolean syspath)
 
sfx_tS_PrecacheSound2 (const char *sample, qboolean syspath)
 
void S_UntouchAll (void)
 
void S_ClearPrecache (void)
 
void S_BeginPrecaching (void)
 
void S_EndPrecaching (void)
 
void S_PaintChannels (soundcardinfo_t *sc, int endtime)
 
void S_InitPaintChannels (soundcardinfo_t *sc)
 
soundcardinfo_tS_SetupDeviceSeat (char *driver, char *device, int seat)
 
void S_ShutdownCard (soundcardinfo_t *sc)
 
void S_DefaultSpeakerConfiguration (soundcardinfo_t *sc)
 
void S_ResetFailedLoad (void)
 
void S_Voip_Parse (void)
 
void S_Voip_Transmit (unsigned char clc, sizebuf_t *buf)
 
void S_Voip_MapChange (void)
 
int S_Voip_Loudness (qboolean ignorevad)
 
int S_Voip_ClientLoudness (unsigned int plno)
 
qboolean S_Voip_Speaking (unsigned int plno)
 
void S_Voip_Ignore (unsigned int plno, qboolean ignore)
 
qboolean S_IsPlayingSomewhere (sfx_t *s)
 
channel_tSND_PickChannel (soundcardinfo_t *sc, int entnum, int entchannel)
 
void SND_ResampleStream (void *in, int inrate, qaudiofmt_t inwidth, int inchannels, int insamps, void *out, int outrate, qaudiofmt_t outwidth, int outchannels, int resampstyle)
 
void S_DoRestart (qboolean onlyifneeded)
 
void S_Restart_f (void)
 
void S_RawAudio (int sourceid, qbyte *data, int speed, int samples, int channels, qaudiofmt_t width, float volume)
 
void CLVC_Poll (void)
 
void SNDVC_MicInput (qbyte *buffer, int samples, int freq, int width)
 
void S_LocalSound (const char *s)
 
void S_LocalSound2 (const char *sound, int channel, float volume)
 
qboolean S_LoadSound (sfx_t *s, qboolean forcedecode)
 
qboolean S_RegisterSoundInputPlugin (void *module, S_LoadSound_t loadfnc)
 
void S_UnregisterSoundInputModule (void *module)
 
void S_AmbientOff (void)
 
void S_AmbientOn (void)
 

Variables

struct sndreverbproperties_sreverbproperties
 
size_t numreverbproperties
 
cvar_t snd_voip_showmeter
 
int snd_speed
 
cvar_t snd_nominaldistance
 
cvar_t snd_loadas8bit
 
cvar_t bgmvolume
 
cvar_t volume
 
cvar_t mastervolume
 
cvar_t snd_capture
 
cvar_t nosound
 
float voicevolumemod
 
qboolean snd_initialized
 
cvar_t snd_mixerthread
 
int snd_blocked
 
soundcardinfo_tsndcardinfo
 

Typedef Documentation

◆ S_LoadSound_t

typedef qboolean(QDECL * S_LoadSound_t) (sfx_t *s, qbyte *data, size_t datalen, int sndspeed, qboolean forcedecode)

◆ sfx_t

typedef struct sfx_s sfx_t

◆ sfxcache_t

typedef struct sfxcache_s sfxcache_t

◆ soundcardinfo_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SLS_NOTLOADED 
SLS_LOADING 
SLS_LOADED 
SLS_FAILED 

◆ chanupdatereason_t

Enumerator
CUR_SPACIALISEONLY 
CUR_UPDATE 
CUR_SOUNDCHANGE 
CUR_OFFSET 
CUR_EVERYTHING 

◆ qaudiofmt_t

Enumerator
QAF_BLOB 
QAF_S8 
QAF_S16 
QAF_F32 

Function Documentation

◆ CLVC_Poll()

void CLVC_Poll ( void  )

◆ Media_CrossFade()

float Media_CrossFade ( int  musicchanel,
float  vol,
float  time 
)

◆ Media_NextTrack()

sfx_t * Media_NextTrack ( int  musicchanel,
float *  time 
)

◆ S_AmbientOff()

void S_AmbientOff ( void  )

◆ S_AmbientOn()

void S_AmbientOn ( void  )

◆ S_BeginPrecaching()

void S_BeginPrecaching ( void  )

◆ S_ClearPrecache()

void S_ClearPrecache ( void  )

◆ S_DefaultSpeakerConfiguration()

void S_DefaultSpeakerConfiguration ( soundcardinfo_t sc)

◆ S_DoRestart()

void S_DoRestart ( qboolean  onlyifneeded)

◆ S_EndPrecaching()

void S_EndPrecaching ( void  )

◆ S_EnumerateDevices()

void S_EnumerateDevices ( void  )

◆ S_ExtraUpdate()

void S_ExtraUpdate ( void  )

◆ S_FindName()

sfx_t * S_FindName ( const char *  name,
qboolean  create,
qboolean  syspath 
)

◆ S_GetChannelLevel()

float S_GetChannelLevel ( int  entnum,
int  entchannel 
)

◆ S_GetListenerInfo()

void S_GetListenerInfo ( int  seat,
float *  origin,
float *  forward,
float *  right,
float *  up 
)

◆ S_GetMusicInfo()

qboolean S_GetMusicInfo ( int  musicchannel,
float *  time,
float *  duration,
char *  title,
size_t  titlesize 
)

◆ S_GetSoundTime()

float S_GetSoundTime ( int  entnum,
int  entchannel 
)

◆ S_HaveOutput()

qboolean S_HaveOutput ( void  )

◆ S_Init()

void S_Init ( void  )

◆ S_InitPaintChannels()

void S_InitPaintChannels ( soundcardinfo_t sc)

◆ S_IsPlayingSomewhere()

qboolean S_IsPlayingSomewhere ( sfx_t s)

◆ S_LoadSound()

qboolean S_LoadSound ( sfx_t s,
qboolean  forcedecode 
)

◆ S_LocalSound()

void S_LocalSound ( const char *  s)

◆ S_LocalSound2()

void S_LocalSound2 ( const char *  sound,
int  channel,
float  volume 
)

◆ S_LockMixer()

void S_LockMixer ( void  )

◆ S_MixerThread()

void S_MixerThread ( soundcardinfo_t sc)

◆ S_Music_Clear()

void S_Music_Clear ( sfx_t onlyifsample)

◆ S_Music_Playing()

qboolean S_Music_Playing ( int  musicchannel)

◆ S_Music_Seek()

void S_Music_Seek ( float  time)

◆ S_PaintChannels()

void S_PaintChannels ( soundcardinfo_t sc,
int  endtime 
)

◆ S_PrecacheSound2()

sfx_t * S_PrecacheSound2 ( const char *  sample,
qboolean  syspath 
)

◆ S_Purge()

void S_Purge ( qboolean  retaintouched)

◆ S_RawAudio()

void S_RawAudio ( int  sourceid,
qbyte data,
int  speed,
int  samples,
int  channels,
qaudiofmt_t  width,
float  volume 
)

◆ S_RegisterSoundInputPlugin()

qboolean S_RegisterSoundInputPlugin ( void module,
S_LoadSound_t  loadfnc 
)

◆ S_ResetFailedLoad()

void S_ResetFailedLoad ( void  )

◆ S_Restart_f()

void S_Restart_f ( void  )

◆ S_SetupDeviceSeat()

soundcardinfo_t * S_SetupDeviceSeat ( char *  driver,
char *  device,
int  seat 
)

◆ S_Shutdown()

void S_Shutdown ( qboolean  final)

◆ S_ShutdownCard()

void S_ShutdownCard ( soundcardinfo_t sc)

◆ S_StartSound()

void S_StartSound ( int  entnum,
int  entchannel,
sfx_t sfx,
vec3_t  origin,
vec3_t  velocity,
float  fvol,
float  attenuation,
float  timeofs,
float  pitchadj,
unsigned int  flags 
)

◆ S_Startup()

void S_Startup ( void  )

◆ S_StaticSound()

void S_StaticSound ( sfx_t sfx,
vec3_t  origin,
float  vol,
float  attenuation 
)

◆ S_StopAllSounds()

void S_StopAllSounds ( qboolean  clear)

◆ S_StopSound()

void S_StopSound ( int  entnum,
int  entchannel 
)

◆ S_UnlockMixer()

void S_UnlockMixer ( void  )

◆ S_UnregisterSoundInputModule()

void S_UnregisterSoundInputModule ( void module)

◆ S_UntouchAll()

void S_UntouchAll ( void  )

◆ S_Update()

void S_Update ( void  )

◆ S_UpdateListener()

void S_UpdateListener ( int  seat,
int  entnum,
vec3_t  origin,
vec3_t  forward,
vec3_t  right,
vec3_t  up,
size_t  reverbtype,
vec3_t  velocity 
)

◆ S_UpdateReverb()

qboolean S_UpdateReverb ( size_t  reverbtype,
void reverb,
size_t  reverbsize 
)

◆ S_UpdateSound()

float S_UpdateSound ( int  entnum,
int  entchannel,
sfx_t sfx,
vec3_t  origin,
vec3_t  velocity,
float  fvol,
float  attenuation,
float  timeofs,
float  pitchadj,
unsigned int  flags 
)

◆ S_Voip_ClientLoudness()

int S_Voip_ClientLoudness ( unsigned int  plno)

◆ S_Voip_Ignore()

void S_Voip_Ignore ( unsigned int  plno,
qboolean  ignore 
)

◆ S_Voip_Loudness()

int S_Voip_Loudness ( qboolean  ignorevad)

◆ S_Voip_MapChange()

void S_Voip_MapChange ( void  )

◆ S_Voip_Parse()

void S_Voip_Parse ( void  )

◆ S_Voip_Speaking()

qboolean S_Voip_Speaking ( unsigned int  plno)

◆ S_Voip_Transmit()

void S_Voip_Transmit ( unsigned char  clc,
sizebuf_t buf 
)

◆ SND_PickChannel()

channel_t * SND_PickChannel ( soundcardinfo_t sc,
int  entnum,
int  entchannel 
)

◆ SND_ResampleStream()

void SND_ResampleStream ( void in,
int  inrate,
qaudiofmt_t  inwidth,
int  inchannels,
int  insamps,
void out,
int  outrate,
qaudiofmt_t  outwidth,
int  outchannels,
int  resampstyle 
)

◆ SNDVC_MicInput()

void SNDVC_MicInput ( qbyte buffer,
int  samples,
int  freq,
int  width 
)

Variable Documentation

◆ bgmvolume

cvar_t bgmvolume
extern

◆ mastervolume

cvar_t mastervolume

◆ nosound

cvar_t nosound
extern

◆ numreverbproperties

size_t numreverbproperties
extern

◆ reverbproperties

struct sndreverbproperties_s * reverbproperties

◆ snd_blocked

int snd_blocked
extern

◆ snd_capture

cvar_t snd_capture
extern

◆ snd_initialized

qboolean snd_initialized
extern

◆ snd_loadas8bit

cvar_t snd_loadas8bit
extern

◆ snd_mixerthread

cvar_t snd_mixerthread
extern

◆ snd_nominaldistance

cvar_t snd_nominaldistance
extern

◆ snd_speed

int snd_speed
extern

◆ snd_voip_showmeter

cvar_t snd_voip_showmeter
extern

◆ sndcardinfo

soundcardinfo_t* sndcardinfo
extern

◆ voicevolumemod

float voicevolumemod
extern

◆ volume

cvar_t volume
extern