Force directsound to fix wrong-pitch sound effects

This commit is contained in:
mazmazz 2018-12-08 14:05:58 -05:00
parent 1029463741
commit 01f1933f69
2 changed files with 12 additions and 0 deletions

View file

@ -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)
{

View file

@ -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");