diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 3f9b09f1..083ef005 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -92,6 +92,12 @@ void I_StartupSound(void) { I_Assert(!sound_started); +#ifdef _WIN32 + // Force DirectSound instead of WASAPI + // SDL 2.0.6+ defaults to the latter and it screws up our sound effects + SDL_setenv("SDL_AUDIODRIVER", "directsound", 1); +#endif + // EE inits audio first so we're following along. if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO) { diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index f4796cd8..41210279 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1186,6 +1186,12 @@ void I_StartupSound(void) // Configure sound device CONS_Printf("I_StartupSound:\n"); +#ifdef _WIN32 + // Force DirectSound instead of WASAPI + // SDL 2.0.6+ defaults to the latter and it screws up our sound effects + SDL_setenv("SDL_AUDIODRIVER", "directsound", 1); +#endif + // EE inits audio first so we're following along. if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO) CONS_Printf("SDL Audio already started\n");