SDL/src/audio
Clownacy fda7c0b461 Fix DirectSound buffer creation failure with >200kHz
Caps the sample rate at 200kHz so that SDL's mixer will downsample any streams which are higher than that.

My Mega Drive emulator outputs at 223721Hz (the sample rate of the PSG chip), and `SDL_OpenAudioDeviceStream` fails due to DirectSound's `CreateSoundBuffer` returning an 'invalid parameter' error code. Lowering the sample rate makes the error go away.

Reported to me by @B3HKO in this issue:
https://github.com/Clownacy/clownmdemu-frontend/issues/60

The 200kHz limit is documented here:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee419022(v=vs.85)

DirectSound's Wikipedia article mentions that problems may occur with sample rates above 192kHz, but no source is provided, so I am unsure whether to take it seriously.

(cherry picked from commit 6efe0e19a7)
2026-03-25 13:24:03 -07:00
..
aaudio Use 20 ms as the default audio buffer size on Android 2026-02-13 14:35:25 -08:00
alsa Fix typos in comments. 2026-01-30 07:25:35 -08:00
coreaudio Updated copyright for 2026 2026-01-01 09:48:19 -08:00
directsound Fix DirectSound buffer creation failure with >200kHz 2026-03-25 13:24:03 -07:00
disk Updated copyright for 2026 2026-01-01 09:48:19 -08:00
dsp Updated copyright for 2026 2026-01-01 09:48:19 -08:00
dummy dummyaudio: Remove bitrotted support for __EMSCRIPTEN_PTHREADS__ code path. 2026-02-08 09:32:18 -08:00
emscripten emscripten: Cleanup some wasm32/wasm64 ifdefs. 2026-02-02 19:23:33 -05:00
haiku Updated copyright for 2026 2026-01-01 09:48:19 -08:00
jack Updated copyright for 2026 2026-01-01 09:48:19 -08:00
n3ds Updated copyright for 2026 2026-01-01 09:48:19 -08:00
netbsd Updated copyright for 2026 2026-01-01 09:48:19 -08:00
ngage Merge all occurances of __func__ and __FUNCTION__ to SDL_FUNCTION 2026-02-08 11:56:12 -08:00
openslES Updated copyright for 2026 2026-01-01 09:48:19 -08:00
pipewire Updated copyright for 2026 2026-01-01 09:48:19 -08:00
ps2 Updated copyright for 2026 2026-01-01 09:48:19 -08:00
psp Updated copyright for 2026 2026-01-01 09:48:19 -08:00
pulseaudio Updated copyright for 2026 2026-01-01 09:48:19 -08:00
qnx Updated copyright for 2026 2026-01-01 09:48:19 -08:00
sndio Updated copyright for 2026 2026-01-01 09:48:19 -08:00
vita Updated copyright for 2026 2026-01-01 09:48:19 -08:00
wasapi wasapi: Patched to compile. 2026-02-10 11:35:33 -05:00
SDL_audio.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audio_c.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audio_channel_converters.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audiocvt.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audiodev.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audiodev_c.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audioqueue.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audioqueue.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audioresample.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audioresample.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_audiotypecvt.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_mixer.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_sysaudio.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_wave.c Updated copyright for 2026 2026-01-01 09:48:19 -08:00
SDL_wave.h Updated copyright for 2026 2026-01-01 09:48:19 -08:00