- s = getenv("QUAKE_SOUND_CHANNELS");
- if (s)
- shm->channels = atoi(s);
- else if ((i = COM_CheckParm("-sndmono")) != 0)
- shm->channels = 1;
- else if ((i = COM_CheckParm("-sndstereo")) != 0)
- shm->channels = 2;
- else
- shm->channels = 2;
-
- shm->samples = info.fragstotal * info.fragsize / (shm->samplebits/8);
-
- // memory map the dma buffer
- shm->bufferlength = info.fragstotal * info.fragsize;
- shm->buffer = (unsigned char *) mmap(NULL, shm->bufferlength, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
- if (!shm->buffer || shm->buffer == (unsigned char *)-1)