Merge branch 'sdl-sound-fix' into 'master'

SDL: Force use DirectSound driver to fix wrong-pitch sound effects

See merge request STJr/SRB2!375
This commit is contained in:
Monster Iestyn 2018-12-16 17:16:49 -05:00
commit 6b1b11441d
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");