- for (channels = 8;channels >= 1;channels--)
- {
- if ((channels & 1) && channels != 1)
- continue;
-// COMMANDLINEOPTION: SDL Sound: -sndmono sets sound output to mono
- if ((i=COM_CheckParm("-sndmono")) != 0)
- if (channels != 1)
- continue;
-// COMMANDLINEOPTION: SDL Sound: -sndstereo sets sound output to stereo
- if ((i=COM_CheckParm("-sndstereo")) != 0)
- if (channels != 2)
- continue;
- // Init the SDL Audio subsystem
- wantspec.callback = Buffer_Callback;
- wantspec.userdata = NULL;
- wantspec.freq = 44100;
- // COMMANDLINEOPTION: SDL Sound: -sndspeed <hz> chooses sound output rate (try values such as 44100, 48000, 22050, 11025 (quake), 24000, 32000, 96000, 192000, etc)
- i = COM_CheckParm( "-sndspeed" );
- if( i && i != ( com_argc - 1 ) )
- wantspec.freq = atoi( com_argv[ i+1 ] );
- wantspec.format = AUDIO_S16SYS;
- wantspec.channels = channels;
- wantspec.samples = AUDIO_SDL_SAMPLEFRAMES;
-
- if( SDL_OpenAudio( &wantspec, NULL ) )
- {
- Con_Printf("%s\n", SDL_GetError());
- continue;
- }