From 84ed01df53cd557eb126c1f6badef7d9201add5f Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 11 Jan 2015 17:27:45 +0100 Subject: [PATCH] Android audio: Add ability to not override the sample rate to 44khz --- android/app-android.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/android/app-android.cpp b/android/app-android.cpp index c3407aa86c..b4fc8dd6ed 100644 --- a/android/app-android.cpp +++ b/android/app-android.cpp @@ -246,10 +246,12 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init } extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioInit(JNIEnv *, jclass) { - // TODO: PPSSPP doesn't support 48khz yet so let's not use that yet. - ILOG("NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: 44100", optimalFramesPerBuffer, optimalSampleRate); - sampleRate = 44100; + sampleRate = optimalSampleRate; + if (NativeQueryConfig("force44khz") != "0") { + sampleRate = 44100; + } framesPerBuffer = optimalFramesPerBuffer; + ILOG("NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: %i", optimalFramesPerBuffer, optimalSampleRate, sampleRate); AndroidAudio_Init(&NativeMix, library_path, framesPerBuffer, sampleRate); }