Simple DirectMedia Layer https://libsdl.org
Find a file
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
.github ci: clang-tools-extra is no longer available for mingw32 2026-03-25 18:57:33 +01:00
android-project Fix backspace on android with api 30+ 2026-03-03 17:12:28 -08:00
build-scripts release: synchronize build-scripts/build-release.py 2026-01-21 21:52:07 +01:00
cmake Fix endmacro syntax in macros.cmake 2026-03-25 08:31:21 -07:00
docs Updated documentation on customizing your Android app name 2026-03-21 16:04:09 -07:00
examples examples: Make source code and console tabs take 80% of browser page. 2026-02-16 13:17:55 -05:00
include Clarified SDL_MostSignificantBitIndex32() documentation 2026-03-22 17:52:54 -07:00
src Fix DirectSound buffer creation failure with >200kHz 2026-03-25 13:24:03 -07:00
test vulkan: Only enable KHR_portability_enumeration when available 2026-02-20 11:35:37 -05:00
VisualC SDL_test: allow disabling colorized output 2025-12-15 23:19:25 +01:00
VisualC-GDK Revert "render: Added Xbox DXIL for gpu backend". 2026-03-04 15:52:52 -05:00
wayland-protocols wayland: Update the color management protocol 2025-12-15 13:54:31 -05:00
Xcode Updated to version 3.4.3 for development 2026-02-20 15:59:20 -08:00
.clang-format Add 'wl_list_for_each_safe' to the clang-format macro list 2024-03-14 10:22:23 -04:00
.clang-tidy
.editorconfig .editorconfig: Remove excess apostrophe at *.cocci 2024-06-16 09:18:17 -07:00
.gitignore Updated .gitignore for png test data 2025-10-10 08:59:27 -07:00
.wikiheaders-options wikiheaders: Generate a current list of supported environment variables. 2025-09-02 15:49:52 -04:00
Android.mk android: remove dependency on cpu-features.h 2025-11-11 23:41:43 +00:00
BUGS.txt Added a Discord link to BUGS.txt 2025-01-13 16:42:50 -08:00
CMakeLists.txt Updated to version 3.4.3 for development 2026-02-20 15:59:20 -08:00
CREDITS.md Updated the credits for SDL 3.0 2025-01-13 16:42:50 -08:00
INSTALL.md Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
LICENSE.txt Updated copyright for 2026 2026-01-01 09:48:19 -08:00
README.md Revert "Update README.md" 2025-11-16 01:15:10 +03:00
WhatsNew.txt Added SDL_HINT_MOUSE_DPI_SCALE_CURSORS 2025-12-09 17:12:08 -08: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)