FTEQW
Documentation of the FTE engine source tree.
sound.h
Go to the documentation of this file.
1/*
2Copyright (C) 1996-1997 Id Software, Inc.
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20// sound.h -- client sound i/o functions
21
22#ifndef __SOUND__
23#define __SOUND__
24
25//#define MIXER_F32
26#define MAXSOUNDCHANNELS 8 //on a per device basis
27
28//pitch/rate changes require that we track stuff with subsample precision.
29//this can result in some awkward overflows.
30#define ssamplepos_t qintptr_t
31#define usamplepos_t quintptr_t
32#define PITCHSHIFT 6 /*max audio file length = ((1<<32)>>PITCHSHIFT)/KHZ*/
33
34struct sfx_s;
35
36typedef struct {
37 struct sfxcache_s *(QDECL *decodedata) (struct sfx_s *sfx, struct sfxcache_s *buf, ssamplepos_t start, int length); //return true when done.
38 float (QDECL *querydata) (struct sfx_s *sfx, struct sfxcache_s *buf, char *title, size_t titlesize); //reports length + original format info without actually decoding anything.
39 void (QDECL *ended) (struct sfx_s *sfx); //sound stopped playing and is now silent (allow rewinding or something).
40 void (QDECL *purge) (struct sfx_s *sfx); //sound is being purged from memory. destroy everything.
41 void *buf;
43
44enum
45{
46 SLS_NOTLOADED, //not tried to load it
47 SLS_LOADING, //loading it on a worker thread.
48 SLS_LOADED, //currently in memory and usable.
49 SLS_FAILED //already tried to load it. it won't work. not found, invalid format, etc
50};
51typedef struct sfx_s
52{
53 char name[MAX_OSPATH];
55
56 int loadstate; //no more super-spammy
57 qboolean touched:1; //if the sound is still relevent
58 qboolean syspath:1; //if the sound is still relevent
59
60 int loopstart; //-1 or sample index to begin looping at once the sample ends
62
63typedef enum
64{
65#ifdef FTE_TARGET_WEB
67#endif
69 //QAF_U8=0x80|1,
71 //QAF_S32=4,
72#ifdef MIXER_F32
73 QAF_F32=0x80|4,
74#endif
75#define QAF_BYTES(v) (v&0x7f) //to make memory allocation easier.
77
78// !!! if this is changed, it much be changed in asm_i386.h too !!!
79typedef struct sfxcache_s
80{
81 usamplepos_t length; //sample count
82 unsigned int speed;
84 unsigned int numchannels;
85 usamplepos_t soundoffset; //byte index into the sound
86 qbyte *data; // variable sized
88
89typedef struct
90{
91 int numchannels; // this many samples per frame
92 int samples; // mono samples in buffer (individual, non grouped)
93 int samplepos; // in mono samples
94 int samplebytes; // per channel (NOT per frame)
95 enum
96 {
97 QSF_INVALID, //not selected yet...
98 QSF_EXTERNALMIXER, //this sample format is totally irrelevant as this device uses some sort of external mixer.
99 QSF_U8, //FIXME: more unsigned formats need changes to S_ClearBuffer
100 QSF_S8, //signed 8bit format is actually quite rare.
101 QSF_S16, //normal format
102// QSF_X8_S24, //upper 8 bits unused. hopefully we don't need any packed thing
103// QSF_S32, //lower 8 bits probably unused. this makes overflow detection messy.
104 QSF_F32, //modern mixers can use SSE/SIMD stuff, and we can skip clamping so this can be quite nippy.
105 } sampleformat;
106 int speed; // this many frames per second
107 unsigned char *buffer; // pointer to mixed pcm buffer (not directly used by mixer)
108} dma_t;
109
110//client and server
111#define CF_SV_RELIABLE 1 // send reliably
112#define CF_NET_SENTVELOCITY CF_SV_RELIABLE
113#define CF_FORCELOOP 2 // forces looping. set on static sounds.
114#define CF_NOSPACIALISE 4 // these sounds are played at a fixed volume in both speakers, but still gets quieter with distance.
115//#define CF_PAUSED 8 // rate = 0. or something.
116#define CF_CL_ABSVOLUME 16 // ignores volume cvar (but not mastervolume). this is ignored if received from the server because there's no practical way for the server to respect the client's preferences.
117//#define CF_SV_RESERVED CF_CL_ABSVOLUME
118#define CF_NOREVERB 32 // disables reverb on this channel, if possible.
119#define CF_FOLLOW 64 // follows the owning entity (stops moving if we lose track)
120#define CF_NOREPLACE 128 // start sound event is ignored if there's already a sound playing on that entchannel (probably paired with CF_FORCELOOP).
121
122#define CF_SV_UNICAST 256 // serverside only. the sound is sent to msg_entity only.
123#define CF_SV_SENDVELOCITY 512 // serverside hint that velocity is important
124#define CF_CLI_AUTOSOUND 1024 // generated from q2 entities, which avoids breaking regular sounds, using it outside the sound system will probably break things.
125#define CF_CLI_INACTIVE 2048 // try to play even when inactive
126#ifdef Q3CLIENT
127#define CF_CLI_NODUPES 4096 // block multiple identical sounds being started on the same entity within rapid succession (regardless of channel). required by quake3.
128#endif
129#define CF_CLI_STATIC 8192 //started via ambientsound/svc_spawnstaticsound
130#define CF_NETWORKED (CF_NOSPACIALISE|CF_NOREVERB|CF_FORCELOOP|CF_FOLLOW|CF_NOREPLACE)
131
132typedef struct
133{
134 sfx_t *sfx; // sfx number
135 int vol[MAXSOUNDCHANNELS]; // volume, 0.8 fixed point.
136 ssamplepos_t pos; // sample position in sfx, <0 means delay sound start (shifted up by PITCHSHIFT)
137 int rate; // fixed point rate scaling
138 int flags; // cf_ flags
139 int entnum; // to allow overriding a specific sound
140 int entchannel; // to avoid overriding a specific sound too easily
141 vec3_t origin; // origin of sound effect
142 vec3_t velocity; // velocity of sound effect
143 vec_t dist_mult; // distance multiplier (attenuation/clipK)
144 int master_vol; // 0-255 master volume
145#ifdef Q3CLIENT
146 unsigned int starttime; // start time, to replicate q3's 50ms embargo on duped sounds.
147#endif
148} channel_t;
149
150struct soundcardinfo_s;
152
154{
157 { //note: this struct originally comes from openal's eaxreverb
158 //it is shared with gamecode
161 float flGain;
162 float flGainHF;
163 float flGainLF;
184extern size_t numreverbproperties;
185
186//reverbproperties_s presets, from efx-presets.h
187//mostly for testing
188#define REVERB_PRESET_PSYCHOTIC \
189 { 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
190//default reverb 1
191#define REVERB_PRESET_UNDERWATER \
192 { 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
193
194void S_Init (void);
195void S_Startup (void);
196void S_EnumerateDevices(void);
197void S_Shutdown (qboolean final);
198float S_GetSoundTime(int entnum, int entchannel);
199float S_GetChannelLevel(int entnum, int entchannel);
200void 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);
201float 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);
202void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
203void S_StopSound (int entnum, int entchannel);
204void S_StopAllSounds(qboolean clear);
205void S_UpdateListener(int seat, int entnum, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, size_t reverbtype, vec3_t velocity);
206qboolean S_UpdateReverb(size_t reverbtype, void *reverb, size_t reverbsize);
207void S_GetListenerInfo(int seat, float *origin, float *forward, float *right, float *up);
208void S_Update (void);
209void S_ExtraUpdate (void);
211void S_Purge(qboolean retaintouched);
212
213void S_LockMixer(void);
214void S_UnlockMixer(void);
215
217
218void S_Music_Clear(sfx_t *onlyifsample);
219void S_Music_Seek(float time);
220qboolean S_GetMusicInfo(int musicchannel, float *time, float *duration, char *title, size_t titlesize);
221qboolean S_Music_Playing(int musicchannel);
222float Media_CrossFade(int musicchanel, float vol, float time); //queries the volume we're meant to be playing (checks for fade out). -1 for no more, otherwise returns vol.
223sfx_t *Media_NextTrack(int musicchanel, float *time); //queries the track we're meant to be playing now.
224
225sfx_t *S_FindName (const char *name, qboolean create, qboolean syspath);
226sfx_t *S_PrecacheSound2 (const char *sample, qboolean syspath);
227#define S_PrecacheSound(s) S_PrecacheSound2(s,false)
228void S_UntouchAll(void);
229void S_ClearPrecache (void);
231void S_EndPrecaching (void);
232
233void S_PaintChannels(soundcardinfo_t *sc, int endtime);
235
236soundcardinfo_t *S_SetupDeviceSeat(char *driver, char *device, int seat);
238
240void S_ResetFailedLoad(void);
241
242#ifdef PEXT2_VOICECHAT
243void S_Voip_Parse(void);
244#endif
245#ifdef VOICECHAT
247void S_Voip_Transmit(unsigned char clc, sizebuf_t *buf);
248void S_Voip_MapChange(void);
249int S_Voip_Loudness(qboolean ignorevad); //-1 for not capturing, otherwise between 0 and 100
250int S_Voip_ClientLoudness(unsigned int plno);
251qboolean S_Voip_Speaking(unsigned int plno);
252void S_Voip_Ignore(unsigned int plno, qboolean ignore);
253#else
254#define S_Voip_Loudness() -1
255#define S_Voip_Speaking(p) false
256#define S_Voip_Ignore(p,s)
257#endif
258
260//qboolean ResampleSfx (sfx_t *sfx, int inrate, int inchannels, int inwidth, int insamps, int inloopstart, qbyte *data);
261
262// picks a channel based on priorities, empty slots, number of channels
263channel_t *SND_PickChannel(soundcardinfo_t *sc, int entnum, int entchannel);
264
265void SND_ResampleStream (void *in, int inrate, qaudiofmt_t inwidth, int inchannels, int insamps, void *out, int outrate, qaudiofmt_t outwidth, int outchannels, int resampstyle);
266
267// restart entire sound subsystem (doesn't flush old sounds, so make sure that happens)
268void S_DoRestart (qboolean onlyifneeded);
269
270void S_Restart_f (void);
271
272//plays streaming audio
273void S_RawAudio(int sourceid, qbyte *data, int speed, int samples, int channels, qaudiofmt_t width, float volume);
274
275void CLVC_Poll (void);
276
278
279
280
281// ====================================================================
282// User-setable variables
283// ====================================================================
284
285#define NUM_MUSICS 1
286
287#define AMBIENT_FIRST 0
288#define AMBIENT_STOP NUM_AMBIENTS
289#define MUSIC_FIRST AMBIENT_STOP
290#define MUSIC_STOP (MUSIC_FIRST + NUM_MUSICS)
291#define DYNAMIC_FIRST MUSIC_STOP
292
293//
294// Fake dma is a synchronous faking of the DMA progress used for
295// isolating performance in the renderer. The fakedma_updates is
296// number of times S_Update() is called per second.
297//
298
299extern int snd_speed;
300
302
304extern cvar_t bgmvolume;
306extern cvar_t snd_capture;
307extern cvar_t nosound;
308
309extern float voicevolumemod;
310
313
314extern int snd_blocked;
315
316void S_LocalSound (const char *s);
317void S_LocalSound2 (const char *sound, int channel, float volume);
318qboolean S_LoadSound (sfx_t *s, qboolean forcedecode);
319
320typedef qboolean (QDECL *S_LoadSound_t) (sfx_t *s, qbyte *data, size_t datalen, int sndspeed, qboolean forcedecode);
321qboolean S_RegisterSoundInputPlugin(void *module, S_LoadSound_t loadfnc); //called to register additional sound input plugins
323
324void S_AmbientOff (void);
325void S_AmbientOn (void);
326
327
328//inititalisation functions.
329typedef struct
330{
331 const char *name; //must be a single token, with no :
332 qboolean (QDECL *InitCard) (soundcardinfo_t *sc, const char *cardname); //NULL for default device.
333 qboolean (QDECL *Enumerate) (void (QDECL *callback) (const char *drivername, const char *devicecode, const char *readablename));
334 void (QDECL *RegisterCvars) (void);
336/*typedef int (*sounddriver) (soundcardinfo_t *sc, int cardnum);
337extern sounddriver pOPENAL_InitCard;
338extern sounddriver pDSOUND_InitCard;
339extern sounddriver pALSA_InitCard;
340extern sounddriver pSNDIO_InitCard;
341extern sounddriver pOSS_InitCard;
342extern sounddriver pSDL_InitCard;
343extern sounddriver pWAV_InitCard;
344extern sounddriver pAHI_InitCard;
345*/
346
347typedef enum
348{
349 CUR_SPACIALISEONLY = 0, //for ticking over, respacialising, etc
350 CUR_UPDATE = (1u<<1), //flags/rate changed without changing the sound itself
351 CUR_SOUNDCHANGE = (1u<<2), //the audio file changed too. reset everything.
352 CUR_OFFSET = (1u<<3),
355
356struct soundcardinfo_s { //windows has one defined AFTER directsound
357 char name[256]; //a description of the card.
358 char guid[256]; //device name as detected (so input code can create sound devices without bugging out too much)
360 int seat;
361
362//speaker orientations for spacialisation.
363 float dist[MAXSOUNDCHANNELS];
364
365 vec3_t speakerdir[MAXSOUNDCHANNELS];
366
367//info on which sound effects are playing
368 //FIXME: use a linked list
371 size_t max_chans;
372
373 float ambientlevels[NUM_AMBIENTS]; //we use a float instead of the channel's int volume value to avoid framerate dependancies with slow transitions.
374
375//mixer
376 volatile dma_t sn; //why is this volatile?
377 qboolean inactive_sound; //continue mixing for this card even when the window isn't active.
378 qboolean selfpainting; //allow the sound code to call the right functions when it feels the need (not properly supported).
379
380 int paintedtime; //used in the mixer as last-written pos (in frames)
381 int oldsamplepos; //this is used to track buffer wraps
382 int buffers; //used to keep track of how many buffer wraps for consistant sound
383 int samplequeue; //this is the number of samples the device can enqueue. if set, DMAPos returns the write point (rather than hardware read point) (in samplepairs).
384
385//callbacks
386 void *(*Lock) (soundcardinfo_t *sc, unsigned int *startoffset); //grab a pointer to the hardware ringbuffer or whatever. startoffset is the starting offset. you can set it to 0 and bump the start offset if you need.
387 void (*Unlock) (soundcardinfo_t *sc, void *buffer); //release the hardware ringbuffer memory
388 void (*Submit) (soundcardinfo_t *sc, int start, int end); //if the ringbuffer is emulated, this is where you should push it to the device.
389 void (*Shutdown) (soundcardinfo_t *sc); //kill the device
390 unsigned int (*GetDMAPos) (soundcardinfo_t *sc); //get the current point that the hardware is reading from (the return value should not wrap, at least not very often)
391 void (*SetEnvironmentReverb) (soundcardinfo_t *sc, size_t reverb); //if you have eax enabled, change the environment. generally this is a stub. optional.
392 void (*Restore) (soundcardinfo_t *sc); //called before lock/unlock/lock/unlock/submit. optional
393 void (*ChannelUpdate) (soundcardinfo_t *sc, channel_t *channel, chanupdatereason_t schanged); //properties of a sound effect changed. this is to notify hardware mixers. optional.
394 void (*ListenerUpdate) (soundcardinfo_t *sc, int entnum, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, vec3_t velocity); //player moved or something. this is to notify hardware mixers. optional.
395 ssamplepos_t (*GetChannelPos) (soundcardinfo_t *sc, channel_t *channel); //queries a hardware mixer's channel position (essentially returns channel->pos, except more up to date)
396
397//driver-specific - if you need more stuff, you should just shove it in the handle pointer
398 void *thread;
399 void *handle;
403};
404
406
407typedef struct
408{
411 qboolean (QDECL *Enumerate) (void (QDECL *callback) (const char *drivername, const char *devicecode, const char *readablename));
412 void *(QDECL *Init) (int samplerate, const char *device); /*create a new context*/
413 void (QDECL *Start) (void *ctx); /*begin grabbing new data, old data is potentially flushed*/
414 unsigned int (QDECL *Update) (void *ctx, unsigned char *buffer, unsigned int minbytes, unsigned int maxbytes); /*grab the data into a different buffer*/
415 void (QDECL *Stop) (void *ctx); /*stop grabbing new data, old data may remain*/
416 void (QDECL *Shutdown) (void *ctx); /*destroy everything*/
418
419#endif
qboolean
Definition: api_menu.h:34
float vec_t
Definition: api_menu.h:38
vec_t vec3_t[3]
Definition: api_menu.h:40
unsigned int width
Definition: bymorphed.h:4
double time
Definition: cl_main.c:306
void(QDECL *vgui_frame)(void)
void dNearCallback * callback
Definition: com_phys_ode.c:655
unsigned char qbyte
Definition: common.h:127
s
Definition: execloop.h:53
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
static CONST PIXELFORMATDESCRIPTOR *static int
Definition: gl_vidnt.c:222
GLsizei const GLcharARB const GLint * length
Definition: glquake.h:149
GLuint GLcharARB * name
Definition: glquake.h:155
void * module
Definition: image.c:236
static png_size_t start
Definition: image.c:1419
char ** data
Definition: p_script.c:63
vec3_t forward
Definition: pmove.c:33
vec3_t right
Definition: pmove.c:33
vec3_t up
Definition: pmove.c:33
evalc_t origin
Definition: pr_menu.c:1356
vec3_t end
Definition: r_d3.c:692
static ALC_API ALCvoid ALCsizei samples
Definition: snd_al.c:259
static AL_API ALenum const ALvoid ALsizei ALsizei freq
Definition: snd_al.c:144
static ALC_API ALCvoid * buffer
Definition: snd_al.c:259
const char const char * readablename
Definition: snd_directx.c:1079
static spx_int16_t * in
Definition: snd_dma.c:488
static SpeexBits spx_int16_t * out
Definition: snd_dma.c:492
@ SLS_FAILED
Definition: sound.h:49
@ SLS_NOTLOADED
Definition: sound.h:46
@ SLS_LOADING
Definition: sound.h:47
@ SLS_LOADED
Definition: sound.h:48
qboolean S_GetMusicInfo(int musicchannel, float *time, float *duration, char *title, size_t titlesize)
Definition: snd_dma.c:3085
void S_LocalSound2(const char *sound, int channel, float volume)
Definition: snd_dma.c:4168
void S_AmbientOff(void)
Definition: snd_dma.c:205
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)
Definition: snd_dma.c:3643
void S_PaintChannels(soundcardinfo_t *sc, int endtime)
Definition: snd_mix.c:212
qboolean S_Voip_Speaking(unsigned int plno)
Definition: snd_dma.c:1727
size_t numreverbproperties
Definition: snd_dma.c:3601
void S_MixerThread(soundcardinfo_t *sc)
Definition: snd_dma.c:4058
void S_Restart_f(void)
Definition: snd_dma.c:2197
cvar_t snd_mixerthread
Definition: snd_dma.c:156
cvar_t nosound
Definition: snd_dma.c:88
cvar_t snd_capture
void CLVC_Poll(void)
void S_DefaultSpeakerConfiguration(soundcardinfo_t *sc)
Definition: snd_dma.c:1777
void S_Purge(qboolean retaintouched)
Definition: snd_dma.c:2508
void S_ResetFailedLoad(void)
Definition: snd_dma.c:2563
void S_Voip_Transmit(unsigned char clc, sizebuf_t *buf)
Definition: snd_dma.c:1149
struct sfxcache_s sfxcache_t
void S_StaticSound(sfx_t *sfx, vec3_t origin, float vol, float attenuation)
Definition: snd_dma.c:3338
cvar_t bgmvolume
Definition: snd_dma.c:83
qboolean snd_initialized
Definition: snd_dma.c:56
qboolean S_UpdateReverb(size_t reverbtype, void *reverb, size_t reverbsize)
Definition: snd_dma.c:3602
int S_Voip_Loudness(qboolean ignorevad)
Definition: snd_dma.c:1711
struct sfx_s sfx_t
qaudiofmt_t
Definition: sound.h:64
@ QAF_S16
Definition: sound.h:70
@ QAF_BLOB
Definition: sound.h:66
@ QAF_S8
Definition: sound.h:68
@ QAF_F32
Definition: sound.h:73
chanupdatereason_t
Definition: sound.h:348
@ CUR_OFFSET
Definition: sound.h:352
@ CUR_SPACIALISEONLY
Definition: sound.h:349
@ CUR_SOUNDCHANGE
Definition: sound.h:351
@ CUR_UPDATE
Definition: sound.h:350
@ CUR_EVERYTHING
Definition: sound.h:353
void S_UntouchAll(void)
Definition: snd_dma.c:2573
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)
Definition: snd_dma.c:2986
int S_Voip_ClientLoudness(unsigned int plno)
Definition: snd_dma.c:1719
soundcardinfo_t * sndcardinfo
Definition: snd_dma.c:52
void S_Startup(void)
Definition: snd_dma.c:2109
channel_t * SND_PickChannel(soundcardinfo_t *sc, int entnum, int entchannel)
Definition: snd_dma.c:2610
void S_GetListenerInfo(int seat, float *origin, float *forward, float *right, float *up)
Definition: snd_dma.c:3658
void S_InitPaintChannels(soundcardinfo_t *sc)
void S_Voip_MapChange(void)
Definition: snd_dma.c:1706
int snd_speed
Definition: snd_dma.c:57
void S_Voip_Ignore(unsigned int plno, qboolean ignore)
Definition: snd_dma.c:1667
sfx_t * S_PrecacheSound2(const char *sample, qboolean syspath)
Definition: snd_dma.c:2586
qboolean(QDECL * S_LoadSound_t)(sfx_t *s, qbyte *data, size_t datalen, int sndspeed, qboolean forcedecode)
Definition: sound.h:320
float S_GetChannelLevel(int entnum, int entchannel)
Definition: snd_dma.c:3152
void S_UnregisterSoundInputModule(void *module)
Definition: snd_mem.c:880
void S_LockMixer(void)
Definition: snd_dma.c:188
void S_Music_Clear(sfx_t *onlyifsample)
Definition: snd_dma.c:3386
cvar_t snd_nominaldistance
Definition: snd_dma.c:69
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)
Definition: snd_mem.c:298
void S_Voip_Parse(void)
Definition: snd_dma.c:1039
soundcardinfo_t * S_SetupDeviceSeat(char *driver, char *device, int seat)
Definition: snd_dma.c:2026
void S_StopAllSounds(qboolean clear)
Definition: snd_dma.c:3256
float voicevolumemod
Definition: snd_dma.c:58
void S_RawAudio(int sourceid, qbyte *data, int speed, int samples, int channels, qaudiofmt_t width, float volume)
Definition: snd_dma.c:4255
cvar_t mastervolume
Definition: sound.h:305
void S_UnlockMixer(void)
Definition: snd_dma.c:192
int snd_blocked
Definition: snd_dma.c:54
qboolean S_LoadSound(sfx_t *s, qboolean forcedecode)
Definition: snd_mem.c:1038
void S_Init(void)
Definition: snd_dma.c:2299
qboolean S_HaveOutput(void)
Definition: snd_dma.c:216
void S_Music_Seek(float time)
Definition: snd_dma.c:3414
void S_BeginPrecaching(void)
void SNDVC_MicInput(qbyte *buffer, int samples, int freq, int width)
sfx_t * S_FindName(const char *name, qboolean create, qboolean syspath)
Definition: snd_dma.c:2471
void S_ShutdownCard(soundcardinfo_t *sc)
Definition: snd_dma.c:2402
void S_ExtraUpdate(void)
Definition: snd_dma.c:3968
void S_EndPrecaching(void)
float Media_CrossFade(int musicchanel, float vol, float time)
Definition: m_mp3.c:299
void S_EnumerateDevices(void)
Definition: snd_dma.c:2069
void S_StopSound(int entnum, int entchannel)
Definition: snd_dma.c:3247
qboolean S_RegisterSoundInputPlugin(void *module, S_LoadSound_t loadfnc)
Definition: snd_mem.c:866
void S_Shutdown(qboolean final)
Definition: snd_dma.c:2419
qboolean S_IsPlayingSomewhere(sfx_t *s)
Definition: snd_dma.c:3216
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)
Definition: snd_dma.c:3024
void S_AmbientOn(void)
Definition: snd_dma.c:211
void S_DoRestart(qboolean onlyifneeded)
Definition: snd_dma.c:2172
void S_Update(void)
Definition: snd_dma.c:3957
sfx_t * Media_NextTrack(int musicchanel, float *time)
Definition: m_mp3.c:178
cvar_t snd_loadas8bit
Definition: snd_dma.c:92
float S_GetSoundTime(int entnum, int entchannel)
Definition: snd_dma.c:3128
qboolean S_Music_Playing(int musicchannel)
Definition: snd_dma.c:3434
void S_LocalSound(const char *s)
Definition: snd_dma.c:4185
void S_ClearPrecache(void)
cvar_t volume
Definition: snd_dma.c:85
struct sndreverbproperties_s * reverbproperties
cvar_t snd_voip_showmeter
Definition: snd_dma.c:172
Definition: sound.h:133
vec_t dist_mult
Definition: sound.h:143
unsigned int starttime
Definition: sound.h:146
ssamplepos_t pos
Definition: sound.h:136
int entchannel
Definition: sound.h:140
int rate
Definition: sound.h:137
vec3_t origin
Definition: sound.h:141
int flags
Definition: sound.h:138
sfx_t * sfx
Definition: sound.h:134
int master_vol
Definition: sound.h:144
vec3_t velocity
Definition: sound.h:142
int entnum
Definition: sound.h:139
Definition: cvar.h:59
Definition: sound.h:90
int samplepos
Definition: sound.h:93
@ QSF_F32
Definition: sound.h:104
@ QSF_EXTERNALMIXER
Definition: sound.h:98
@ QSF_INVALID
Definition: sound.h:97
@ QSF_S8
Definition: sound.h:100
@ QSF_S16
Definition: sound.h:101
@ QSF_U8
Definition: sound.h:99
int samplebytes
Definition: sound.h:94
unsigned char * buffer
Definition: sound.h:107
int samples
Definition: sound.h:92
int speed
Definition: sound.h:106
int numchannels
Definition: sound.h:91
Definition: sound.h:52
int loopstart
Definition: sound.h:60
sfxdecode_t decoder
Definition: sound.h:54
qboolean touched
Definition: sound.h:57
qboolean syspath
Definition: sound.h:58
int loadstate
Definition: sound.h:56
Definition: sound.h:80
usamplepos_t length
Definition: sound.h:81
unsigned int numchannels
Definition: sound.h:84
usamplepos_t soundoffset
Definition: sound.h:85
qbyte * data
Definition: sound.h:86
qaudiofmt_t format
Definition: sound.h:83
unsigned int speed
Definition: sound.h:82
Definition: sound.h:36
void * buf
Definition: sound.h:41
struct sfxcache_s *QDECL * decodedata(struct sfx_s *sfx, struct sfxcache_s *buf, ssamplepos_t start, int length)
struct sfxcache_s * buf
Definition: sound.h:38
void(QDECL *purge)(struct sfx_s *sfx)
void(QDECL *ended)(struct sfx_s *sfx)
Definition: common.h:196
Definition: sound.h:408
void(QDECL *Stop)(void *ctx)
unsigned unsigned char * buffer
Definition: sound.h:414
const char * devicecode
Definition: sound.h:411
void(QDECL *Shutdown)(void *ctx)
char * drivername
Definition: sound.h:410
void *QDECL * Init(int samplerate, const char *device)
int apiver
Definition: sound.h:409
void(QDECL *Start)(void *ctx)
float flGainHF
Definition: sound.h:162
float flLFReference
Definition: sound.h:179
float flReflectionsDelay
Definition: sound.h:168
float flGain
Definition: sound.h:161
float flDiffusion
Definition: sound.h:160
float flRoomRolloffFactor
Definition: sound.h:180
float flDecayLFRatio
Definition: sound.h:166
float flDecayHFRatio
Definition: sound.h:165
float flEchoDepth
Definition: sound.h:174
float flLateReverbPan[3]
Definition: sound.h:172
float flGainLF
Definition: sound.h:163
float flModulationDepth
Definition: sound.h:176
float flDensity
Definition: sound.h:159
float flModulationTime
Definition: sound.h:175
float flDecayTime
Definition: sound.h:164
float flLateReverbGain
Definition: sound.h:170
float flAirAbsorptionGainHF
Definition: sound.h:177
float flEchoTime
Definition: sound.h:173
int iDecayHFLimit
Definition: sound.h:181
float flHFReference
Definition: sound.h:178
float flReflectionsPan[3]
Definition: sound.h:169
float flLateReverbDelay
Definition: sound.h:171
float flReflectionsGain
Definition: sound.h:167
Definition: sound.h:154
struct sndreverbproperties_s::reverbproperties_s props
int modificationcount
Definition: sound.h:155
Definition: sound.h:356
void * thread
Definition: sound.h:398
float ambientlevels[NUM_AMBIENTS]
Definition: sound.h:373
int snd_completed
Definition: sound.h:401
int samplequeue
Definition: sound.h:383
struct soundcardinfo_s * next
Definition: sound.h:359
int oldsamplepos
Definition: sound.h:381
void(* SetEnvironmentReverb)(soundcardinfo_t *sc, size_t reverb)
Definition: sound.h:391
size_t total_chans
Definition: sound.h:370
int buffers
Definition: sound.h:382
void(* ListenerUpdate)(soundcardinfo_t *sc, int entnum, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, vec3_t velocity)
Definition: sound.h:394
void * handle
Definition: sound.h:399
vec3_t speakerdir[MAXSOUNDCHANNELS]
Definition: sound.h:365
float dist[MAXSOUNDCHANNELS]
Definition: sound.h:363
void(* Unlock)(soundcardinfo_t *sc, void *buffer)
Definition: sound.h:387
int seat
Definition: sound.h:360
char guid[256]
Definition: sound.h:358
ssamplepos_t(* GetChannelPos)(soundcardinfo_t *sc, channel_t *channel)
Definition: sound.h:395
qboolean selfpainting
Definition: sound.h:378
void(* Restore)(soundcardinfo_t *sc)
Definition: sound.h:392
volatile dma_t sn
Definition: sound.h:376
int audio_fd
Definition: sound.h:402
int paintedtime
Definition: sound.h:380
size_t max_chans
Definition: sound.h:371
void(* Shutdown)(soundcardinfo_t *sc)
Definition: sound.h:389
void(* ChannelUpdate)(soundcardinfo_t *sc, channel_t *channel, chanupdatereason_t schanged)
Definition: sound.h:393
qboolean inactive_sound
Definition: sound.h:377
unsigned int(* GetDMAPos)(soundcardinfo_t *sc)
Definition: sound.h:390
channel_t * channel
Definition: sound.h:369
void(* Submit)(soundcardinfo_t *sc, int start, int end)
Definition: sound.h:388
int snd_sent
Definition: sound.h:400
Definition: sound.h:330
const char * devicecode
Definition: sound.h:333
const char * cardname
Definition: sound.h:332
void(QDECL *RegisterCvars)(void)
const char * name
Definition: sound.h:331
unsigned int datalen
Definition: sv_user.c:2880
unsigned char buf[KBRINGSIZE]
Definition: sys_dos.c:27
unsigned int flags
Definition: valid.c:313