- // Log_Printf("stereosounds.log", "%s\n", s->name);
-
- // calculate resampled length
- len = (int) ((double) info.samples * (double) shm->format.speed / (double) info.rate);
- len = len * info.width * info.channels;
-
- memsize = len + sizeof (*sb) - sizeof (sb->data);
- sb = (sfxbuffer_t *)Mem_Alloc (snd_mempool, memsize);
- if (sb == NULL)
- {
- Con_Printf("failed to allocate memory for sound \"%s\"\n", s->name);
- Mem_Free(data);
- return false;
- }
- s->memsize += memsize;
-
- s->fetcher = &wav_fetcher;
- s->fetcher_data = sb;
- s->format.speed = info.rate;
- s->format.width = info.width;
- s->format.channels = info.channels;
- if (info.loopstart < 0)
- s->loopstart = -1;
- else
- s->loopstart = (double)info.loopstart * (double)shm->format.speed / (double)s->format.speed;
- s->flags &= ~SFXFLAG_STREAMED;