30typedef struct snd_format_s
30typedef struct snd_format_s {
…};
37typedef struct snd_buffer_s
37typedef struct snd_buffer_s {
…};
45typedef struct snd_ringbuffer_s
45typedef struct snd_ringbuffer_s {
…};
60#define SFXFLAG_FILEMISSING (1 << 0)
61#define SFXFLAG_LEVELSOUND (1 << 1)
62#define SFXFLAG_STREAMED (1 << 2)
63#define SFXFLAG_MENUSOUND (1 << 3)
84#define SND_LISTENERS 8
86typedef struct channel_s
86typedef struct channel_s {
…};
134#define SND_CHANNELLAYOUT_AUTO 0
135#define SND_CHANNELLAYOUT_STANDARD 1
136#define SND_CHANNELLAYOUT_ALSA 2
150#define STREAM_BUFFERSIZE 16384
195typedef struct portable_samplepair_s
195typedef struct portable_samplepair_s {
…};
200typedef struct listener_s
200typedef struct listener_s {
…};
209typedef struct speakerlayout_s
209typedef struct speakerlayout_s {
…};
GLint GLint GLint GLsizei GLsizei GLenum format
#define MAX_QPATH
max length of a quake game pathname
struct mempool_s * snd_mempool
qbool snd_threaded
enables use of snd_usethreadedmixing, provided that no sound hacks are in effect (like timedemo)
void SndSys_Submit(void)
Submit the contents of "snd_renderbuffer" to the sound card.
void SndSys_SendKeyEvents(void)
if the sound system can generate events, send them
bool snd_blocked
When true, we submit silence to the audio device.
snd_ringbuffer_t * Snd_CreateRingBuffer(const snd_format_t *format, unsigned int sampleframes, void *buffer)
If "buffer" is NULL, the function allocates one buffer of "sampleframes" sample frames itself (if "sa...
qbool simsound
If simsound is true, the sound card is not initialized and no sound is submitted to it.
qbool S_LoadSound(struct sfx_s *sfx, qbool complain)
qbool SndSys_Init(snd_format_t *fmt)
Create "snd_renderbuffer", attempting to use the chosen sound format, but accepting if the driver wan...
void S_SetUnderwaterIntensity(void)
unsigned int total_channels
unsigned int SndSys_GetSoundTime(void)
Returns the number of sample frames consumed since the sound started.
void(* snd_fetcher_getsamplesfloat_t)(channel_t *ch, struct sfx_s *sfx, int firstsampleframe, int numsampleframes, float *outsamplesfloat)
void S_MixToBuffer(void *stream, unsigned int frames)
void SndSys_Shutdown(void)
Stop the sound card, delete "snd_renderbuffer" and free its other resources.
channel_t channels[MAX_CHANNELS]
snd_ringbuffer_t * snd_renderbuffer
void(* snd_fetcher_stopchannel_t)(channel_t *ch)
qbool SndSys_LockRenderBuffer(void)
Get the exclusive lock on "snd_renderbuffer".
void(* snd_fetcher_freesfx_t)(struct sfx_s *sfx)
cvar_t snd_streaming_length
qbool snd_usethreadedmixing
if true, the main thread does not mix sound, soundtime does not advance, and neither does snd_renderb...
void SndSys_UnlockRenderBuffer(void)
Release the exclusive lock on "snd_renderbuffer".
unsigned int flags
cf CHANNELFLAG_* defines
int prologic_invert
whether a sound is played on the surround channels in prologic
float basevolume
0-1 master volume
double position
updated ONLY by mixer position in sfx, starts at 0, loops or stops at sfx->total_length
vec_t distfade
distance multiplier (attenuation/clipK)
int entchannel
which channel id on the entity
float basespeed
playback rate multiplier for pitch variation
struct sfx_s * sfx
pointer to sound sample being used
float mixspeed
these are often updated while mixer is running, glitching should be minimized (mismatched channel vol...
vec3_t origin
origin of sound effect
void * fetcher_data
Per-channel data for the sound fetching function.
int entnum
makes sound follow entity origin (allows replacing interrupting existing sound on same id)
int channel_unswapped
for un-swapping
exported for capturevideo so ogg can see all channels
unsigned int loopstart
in sample frames. equals total_length if not looped
void * fetcher_data
Per-sfx data for the sound fetching functions.
snd_format_t format
format describing the audio data that fetcher->getsamplesfloat will return
unsigned int total_length
in sample frames
const snd_fetcher_t * fetcher
unsigned int flags
cf SFXFLAG_* defines
size_t memsize
total memory used (including struct sfx_s and fetcher data)
float volume_mult
for replay gain (multiplier to apply)
float volume_peak
for replay gain (highest peak); if set to 0, ReplayGain isn't supported
unsigned int maxframes
max size (buffer size), in sample frames
unsigned int nbframes
current size, in sample frames
snd_fetcher_freesfx_t freesfx
snd_fetcher_stopchannel_t stopchannel
snd_fetcher_getsamplesfloat_t getsamplesfloat
unsigned int startframe
index of the first frame in the buffer if startframe == endframe, the bufffer is empty
unsigned int maxframes
max size (buffer size), in sample frames
unsigned int endframe
index of the first EMPTY frame in the "ring" buffer may be smaller than startframe if the "ring" buff...