From 6bd4c83568ecbeeb4462f3919deaf84ba39f212f Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 7 Dec 2025 17:12:08 +0100 Subject: [PATCH] Revert "force 44100khz sample rate" This reverts commit ab07a43c06289c3f40083e5588ff37d7bdc968c5. --- src/sdl/sdl_sound.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index f82bb2f08..afe868d9c 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -464,25 +464,18 @@ void I_StartupSound(void) return; } - // supposedly you would be able to get this with SDL_GetAudioDeviceFormat before opening the audio device - // but that doesent work for some strange reason - // assume 16bit, stereo device and force 44.1khz since it sounds the best to me - actual_spec.format = SDL_AUDIO_S16; - actual_spec.channels = 2; - actual_spec.freq = 44100; - - audio_device = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &actual_spec); + audio_device = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, NULL); if (audio_device == 0) { CONS_Alert(CONS_ERROR, "Error opening audio device: %s\n", SDL_GetError()); return; } - /*if (!SDL_GetAudioDeviceFormat(audio_device, &actual_spec, NULL)) - { * - CONS_Alert(CONS_ERROR, "Error retrieving audio format: %s\n", SDL_GetError()); - return; - }*/ + if (!SDL_GetAudioDeviceFormat(audio_device, &actual_spec, NULL)) + { + CONS_Alert(CONS_ERROR, "Error retrieving audio format: %s\n", SDL_GetError()); + return; + } audio_stream = SDL_OpenAudioDeviceStream(audio_device, &actual_spec, StreamCallback, NULL); if (audio_stream == NULL)