- if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1)
- {
- perror("GETOSPACE");
- Con_Printf("Um, can't do GETOSPACE?\n");
- close(audio_fd);
- return 0;
- }
-
- shm = &sn;
- shm->splitbuffer = 0;
-
- // set sample bits & speed
- s = getenv("QUAKE_SOUND_SAMPLEBITS");
- if (s)
- shm->samplebits = atoi(s);
- else if ((i = COM_CheckParm("-sndbits")) != 0)
- shm->samplebits = atoi(com_argv[i+1]);
-
- if (shm->samplebits != 16 && shm->samplebits != 8)
- {
- ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &fmt);
- if (fmt & AFMT_S16_LE)
- shm->samplebits = 16;
- else if (fmt & AFMT_U8)
- shm->samplebits = 8;
- }
+Create "snd_renderbuffer" with the proper sound format if the call is successful
+May return a suggested format if the requested format isn't available
+====================
+*/
+qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
+{
+ int flags, ioctl_param, prev_value;
+ unsigned int fragmentsize;