52 memset(ringbuffer, 0,
sizeof(*ringbuffer));
58 unsigned int maxframes;
61 if (sampleframes == 0)
62 maxframes = (
format->speed + 1) / 2;
64 maxframes = sampleframes;
93 if (sfx->fetcher !=
NULL)
106 sfx->volume_peak = 0.0;
114 if (strncasecmp(sfx->name,
"sound/", 6))
116 dpsnprintf (namebuffer,
sizeof(namebuffer),
"sound/%s", sfx->name);
118 if (len >= 4 && !strcasecmp (namebuffer + len - 4,
".wav"))
122 memcpy (namebuffer + len - 3,
"ogg", 4);
124 if (len >= 4 && !strcasecmp (namebuffer + len - 4,
".ogg"))
139 dpsnprintf (namebuffer,
sizeof(namebuffer),
"%s", sfx->name);
144 if (len >= 4 && !strcasecmp (namebuffer + len - 4,
".wav"))
148 memcpy (namebuffer + len - 3,
"ogg", 4);
150 if (len >= 4 && !strcasecmp (namebuffer + len - 4,
".ogg"))
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
GLint GLint GLint GLsizei GLsizei GLenum format
#define MAX_QPATH
max length of a quake game pathname
snd_ringbuffer_t * snd_renderbuffer
#define SFXFLAG_FILEMISSING
wasn't able to load the associated sound file
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...
void SCR_PopLoadingScreen(qbool)
qbool S_LoadSound(sfx_t *sfx, qbool complain)
void SCR_PushLoadingScreen(const char *, float)
qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx)
qbool S_LoadWavFile(const char *filename, sfx_t *sfx)
qbool XMP_LoadModFile(const char *filename, sfx_t *sfx)
unsigned int maxframes
max size (buffer size), in sample frames
#define Mem_Alloc(pool, size)