36 int samplefrac, fracstep;
43 Com_DPrintf(
"%s resampled to zero length\n",
s_info.
name);
44 sfx->
error = Q_ERR_TOO_FEW;
61 #if __BYTE_ORDER == __LITTLE_ENDIAN
64 for (i = 0; i < outcount; i++) {
65 ((uint16_t *)sc->
data)[i] = LittleShort(((uint16_t *)
s_info.
data)[i]);
72 fracstep = stepscale * 256;
74 for (i = 0; i < outcount; i++) {
75 srcsample = samplefrac >> 8;
76 samplefrac += fracstep;
80 for (i = 0; i < outcount; i++) {
81 srcsample = samplefrac >> 8;
82 samplefrac += fracstep;
83 ((uint16_t *)sc->
data)[i] = LittleShort(((uint16_t *)
s_info.
data)[srcsample]);
113 val = LittleShortMem(
data_p);
126 val = LittleLongMem(
data_p);
140 if (len > remaining) {
143 if (chunk == search) {
160 #define TAG_RIFF MakeRawLong('R', 'I', 'F', 'F')
161 #define TAG_WAVE MakeRawLong('W', 'A', 'V', 'E')
162 #define TAG_fmt MakeRawLong('f', 'm', 't', ' ')
163 #define TAG_cue MakeRawLong('c', 'u', 'e', ' ')
164 #define TAG_LIST MakeRawLong('L', 'I', 'S', 'T')
165 #define TAG_MARK MakeRawLong('M', 'A', 'R', 'K')
166 #define TAG_data MakeRawLong('d', 'a', 't', 'a')
177 Com_DPrintf(
"%s has missing/invalid RIFF chunk\n",
s_info.
name);
182 Com_DPrintf(
"%s has missing/invalid WAVE chunk\n",
s_info.
name);
191 Com_DPrintf(
"%s has missing/invalid fmt chunk\n",
s_info.
name);
196 Com_DPrintf(
"%s has non-Microsoft PCM format\n",
s_info.
name);
202 Com_DPrintf(
"%s has bad number of channels\n",
s_info.
name);
208 Com_DPrintf(
"%s has bad rate\n",
s_info.
name);
223 Com_DPrintf(
"%s has bad width\n",
s_info.
name);
233 Com_DPrintf(
"%s has bad loop start\n",
s_info.
name);
246 Com_DPrintf(
"%s has bad loop length\n",
s_info.
name);
259 Com_DPrintf(
"%s has missing/invalid data chunk\n",
s_info.
name);
265 Com_DPrintf(
"%s has zero length\n",
s_info.
name);
271 Com_DPrintf(
"%s has bad loop length\n",
s_info.
name);
295 if (s->
name[0] ==
'*')
313 len = FS_LoadFile(name, (
void **)&data);
325 s->
error = Q_ERR_INVALID_FORMAT;