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
2026-03-25 08:31:21 -07:00
2025-01-13 16:42:50 -08:00
2025-01-13 16:42:50 -08:00
2025-03-06 16:25:17 -08:00
2026-01-01 09:48:19 -08:00
2025-11-16 01:15:10 +03:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)

Description
No description provided
Readme 228 MiB
Languages
C 85.7%
C++ 6.6%
Objective-C 3.4%
CMake 1.6%
Perl 0.7%
Other 1.7%