From b6d365677b62afbf1e490ea049b2129020b2b3af Mon Sep 17 00:00:00 2001 From: Sylvain Date: Sat, 20 Nov 2021 15:28:36 +0100 Subject: [PATCH] Fixed bug #4982 - Failed to open audio_device on Android 5.x with freq 96khz+ --- .../app/src/main/java/org/libsdl/app/SDLAudioManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java b/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java index 09e44285b..efd068c17 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java @@ -47,6 +47,10 @@ public class SDLAudioManager if (desiredChannels > 2) { desiredChannels = 2; } + } + + /* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */ + if (Build.VERSION.SDK_INT < 23) { if (sampleRate < 8000) { sampleRate = 8000; } else if (sampleRate > 48000) {