diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 3f9b09f10e934d8db387139a6b7e65018a6d70a0..083ef00540ea0de736ae42d3b91ffb2aff4f3ee4 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 f4796cd8067a63056d4157891c2b591b3614b2c2..412102790f10f4bfff5c74f1fcbf04f52a7571a1 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");