From ea5bfbe0013e0ff37e602c022029fdd13aa10cbb Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 16 Apr 2022 09:14:16 +0100 Subject: [PATCH] Default to 48kHz on Windows Refs #1390 --- Source/options.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/options.cpp b/Source/options.cpp index 388feda94..f7b9724cb 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -38,8 +38,17 @@ namespace devilution { #define DEFAULT_HEIGHT 480 #endif #ifndef DEFAULT_AUDIO_SAMPLE_RATE +#if defined(_WIN64) || defined(_WIN32) +// The sound API used by SDL in Windows (WASAPI) isn't great +// at upsampling from 22050 Hz on some drivers. +// +// Upsample ourselves on Windows by default. +// See https://github.com/diasurgical/devilutionX/issues/1390 +#define DEFAULT_AUDIO_SAMPLE_RATE 48000 +#else #define DEFAULT_AUDIO_SAMPLE_RATE 22050 #endif +#endif #ifndef DEFAULT_AUDIO_CHANNELS #define DEFAULT_AUDIO_CHANNELS 2 #endif