// Init the shm structure
memset( (void*) shm, 0, sizeof(*shm) );
// Init the shm structure
memset( (void*) shm, 0, sizeof(*shm) );
shm->samplepos = 0;
shm->samples = AUDIO_SDL_SAMPLES * AUDIO_LOCALFACTOR;
shm->bufferlength = shm->samples * shm->format.width;
shm->samplepos = 0;
shm->samples = AUDIO_SDL_SAMPLES * AUDIO_LOCALFACTOR;
shm->bufferlength = shm->samples * shm->format.width;
if( SDL_OpenAudio( &spec, NULL ) ) {
Con_Print( "Failed to open the audio device!\n" );
if( SDL_OpenAudio( &spec, NULL ) ) {
Con_Print( "Failed to open the audio device!\n" );
spec.channels, spec.format, spec.freq, shm->bufferlength , spec.samples );
spec.channels, spec.format, spec.freq, shm->bufferlength , spec.samples );