- if (sound_status == SOUND_OFF)
- return;
-
-#ifdef USE_SDL_LIBRARY
- /* initialize SDL audio */
-
- if (SDL_Init(SDL_INIT_AUDIO) < 0)
- {
- Error(ERR_WARN, "SDL_Init() failed: %s", SDL_GetError());
- sound_status = SOUND_OFF;
- return;
- }
-
- if (Mix_OpenAudio(22050, AUDIO_S16, 2, 512) < 0)
- {
- Error(ERR_WARN, "Mix_OpenAudio() failed: %s", SDL_GetError());
- sound_status = SOUND_OFF;
- return;
- }
-
- Mix_Volume(-1, SDL_MIX_MAXVOLUME / 4);
- Mix_VolumeMusic(SDL_MIX_MAXVOLUME / 4);
-
- sound_status = SOUND_AVAILABLE;
- sound_loops_allowed = TRUE;
-
-#else /* !USE_SDL_LIBRARY */
-
-#if !defined(MSDOS) && !defined(WIN32)
- if (access(sound_device_name, W_OK) != 0)
- {
- Error(ERR_WARN, "cannot access sound device - no sounds");
- sound_status = SOUND_OFF;
- return;
- }
-
- if ((sound_device = OpenAudio(sound_device_name)) < 0)
- {
- Error(ERR_WARN, "cannot open sound device - no sounds");
- sound_status = SOUND_OFF;
- return;
- }
-
- close(sound_device);
- sound_status = SOUND_AVAILABLE;
-
-#ifdef VOXWARE
- sound_loops_allowed = TRUE;
-
- /*
- setup.sound_loops_on = TRUE;
- */
-
-#endif
-#else /* MSDOS || WIN32 */
- sound_loops_allowed = TRUE;
-
- /*
- setup.sound_loops_on = TRUE;
- */
-
-#endif /* MSDOS || WIN32 */
-#endif /* !USE_SDL_LIBRARY */