android-project/build.gradle
author Sam Lantinga <slouken@libsdl.org>
Tue, 25 Sep 2018 20:08:51 -0700
changeset 12224 0582b4e1fa9f
parent 11647 5816b27073a4
child 12364 351a67dbe9c6
permissions -rw-r--r--
Fixed bug 4268 - Android_JNI_OpenAudioDevice function has error

alittle

where iscapture == 1

1.param set error

(*env)->CallStaticIntMethod(env, mAudioManagerClass, midCaptureOpen, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames)

param:audioBuffer16Bit need change to captureBuffer16Bit

2.logic error

if (is16Bit) {
// ALITTLE Modify the source code
if (iscapture) {
audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)captureBuffer);
} else {
audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
}
// if (!iscapture) {
// audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
// }
// audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
} else {
// ALITTLE Modify the source code
if (iscapture) {
audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)captureBuffer);
} else {
audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
}
// if (!iscapture) {
// audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
// }
// audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
}
slouken@11647
     1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
slouken@11647
     2
slouken@11647
     3
buildscript {
slouken@11647
     4
    repositories {
slouken@11647
     5
        jcenter()
slouken@11647
     6
    }
slouken@11647
     7
    dependencies {
slouken@11647
     8
        classpath 'com.android.tools.build:gradle:2.3.3'
slouken@11647
     9
slouken@11647
    10
        // NOTE: Do not place your application dependencies here; they belong
slouken@11647
    11
        // in the individual module build.gradle files
slouken@11647
    12
    }
slouken@11647
    13
}
slouken@11647
    14
slouken@11647
    15
allprojects {
slouken@11647
    16
    repositories {
slouken@11647
    17
        jcenter()
slouken@11647
    18
    }
slouken@11647
    19
}
slouken@11647
    20
slouken@11647
    21
task clean(type: Delete) {
slouken@11647
    22
    delete rootProject.buildDir
slouken@11647
    23
}