From cb05ed59f2a667176d8ca74f5725ede4c5abf302 Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Sun, 26 May 2024 13:54:52 -0400 Subject: [PATCH] Force audio driver selection to wasapi on Windows to prevent audio issue --- src/main/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/main.cpp b/src/main/main.cpp index e2a60f5..3cc2893 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -323,6 +323,10 @@ int main(int argc, char** argv) { SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi); #endif +#ifdef _WIN32 + // Force wasapi on Windows, as there seems to be some issue with sample queueing with directsound currently. + SDL_setenv("SDL_AUDIODRIVER", "wasapi", true); +#endif //printf("Current dir: %ls\n", std::filesystem::current_path().c_str()); // Initialize SDL audio and set the output frequency.