WAVEFORMATEX format, pformat;
HRESULT hresult;
int reps;
+ int i;
memset ((void *)&sn, 0, sizeof (sn));
shm->channels = 2;
shm->samplebits = 16;
- shm->speed = 44100; // LordHavoc: 44.1khz sound
+ i = COM_CheckParm ("-sndspeed"); // LordHavoc: -sndspeed option
+ if (i && i != (com_argc - 1))
+ shm->speed = atoi(com_argv[i+1]);
+ else
+ shm->speed = 11025;
memset (&format, 0, sizeof(format));
format.wFormatTag = WAVE_FORMAT_PCM;
format.nChannels = shm->channels;
format.wBitsPerSample = shm->samplebits;
format.nSamplesPerSec = shm->speed;
- format.nBlockAlign = format.nChannels
- *format.wBitsPerSample / 8;
+ format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8;
format.cbSize = 0;
- format.nAvgBytesPerSec = format.nSamplesPerSec
- *format.nBlockAlign;
+ format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
if (!hInstDS)
{
if (snd_firsttime)
Con_SafePrintf(" %d channel(s)\n"
" %d bits/sample\n"
- " %d bytes/sec\n",
+ " %d samples/sec\n",
shm->channels, shm->samplebits, shm->speed);
gSndBufSize = dsbcaps.dwBufferBytes;
shm->channels = 2;
shm->samplebits = 16;
- shm->speed = 44100; // LordHavoc: 44.1khz sound
+ i = COM_CheckParm ("-sndspeed"); // LordHavoc: -sndspeed option
+ if (i && i != (com_argc - 1))
+ shm->speed = atoi(com_argv[i+1]);
+ else
+ shm->speed = 11025;
memset (&format, 0, sizeof(format));
format.wFormatTag = WAVE_FORMAT_PCM;