C++ and JNI - How to pass an array into a jfloatArray

后端 未结 4 660
谎友^
谎友^ 2020-12-19 10:10

I have been messing with my own little project to teach myself the android ndk using c++ and jni but I can\'t figure out how to pass the data from a java float array to the

4条回答
  •  情深已故
    2020-12-19 10:25

    validateAudio(JNIEnv* env, jobject obj, jstring resourceFolderPath, ,jfloatArray thresholdArray){
        const char *resource_folder_path = (*env)->GetStringUTFChars(env,resourceFolderPath,0); // string parameter
        const jfloat* threshold_array = (*env)->GetFloatArrayElements(env, thresholdArray,0);  //float array
    }
    

提交回复
热议问题