From eaf49a956ee2bf950d422680feba93c5e6d502c5 Mon Sep 17 00:00:00 2001 From: Milosz Golebiewski Date: Sun, 15 Mar 2020 21:59:24 +0100 Subject: [PATCH] stereo issues fixed --- soundtouch/src/main/cpp/SoundTouchJNI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soundtouch/src/main/cpp/SoundTouchJNI.cpp b/soundtouch/src/main/cpp/SoundTouchJNI.cpp index 77167cb..26f8e9d 100644 --- a/soundtouch/src/main/cpp/SoundTouchJNI.cpp +++ b/soundtouch/src/main/cpp/SoundTouchJNI.cpp @@ -78,11 +78,11 @@ receiveSamples(JNIEnv *env, jobject thiz, jlong handle, jshortArray outSamples, return 0; } - SAMPLETYPE sampleBuffer[maxSamples]; + SAMPLETYPE sampleBuffer[maxSamples*ptr->numChannels()]; uint samples = ptr->receiveSamples(sampleBuffer, (uint) maxSamples); - env->SetShortArrayRegion(outSamples, 0, samples, sampleBuffer); + env->SetShortArrayRegion(outSamples, 0, samples*ptr->numChannels(), sampleBuffer); return samples; }