From 6be8c38aedeb680a4b5aac813dc35b0a273c1047 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 8 Nov 2022 11:20:14 +0100 Subject: [PATCH] allow SDL2_Mixer to adjust sample size --- src/i_sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i_sound.c b/src/i_sound.c index 4e21bd66..0fb8cba5 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -722,7 +722,8 @@ void I_InitSound(void) return; } - if(Mix_OpenAudioDevice(snd_samplerate, MIX_DEFAULT_FORMAT, 2, audio_buffers, NULL, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE) < 0) + if (Mix_OpenAudioDevice(snd_samplerate, AUDIO_S16SYS, 2, audio_buffers, NULL, + SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE) < 0) { printf("Couldn't open audio with desired format.\n"); return;