Darshani Kaushalya
Darshani Kaushalya

Reputation: 125

Cannot resolve corresponding jni function

I am trying to build a real time voice recognition mobile system.I am trying to refer the project in this location https://github.com/chenguangshen/androidSpeakerRec for research purposes. but I am got following error.

enter image description here

This is my header file.

enter image description here

In the header file it says jint is never used and missing a semicolon near jint.

In my .c file after function signature it says expecting semicolon.

enter image description here

How can I resolve this?

Upvotes: 0

Views: 1038

Answers (1)

sharry
sharry

Reputation: 370

Add the .so files in jni folder and build the project.

The format in which .so files should be placed is as follows

main->jni->armeabi->.so files

and the call in cpp file

JNIEXPORT jint JNICALL
Java_RecordService_getSpeaker(JNIEnv *env, jobject instance,
                                                              jshortArray signal_, jint size,
                                                              jint inc) {
    jshort *signal = env->GetShortArrayElements(signal_, NULL);

    // TODO

    env->ReleaseShortArrayElements(signal_, signal, 0);
}

Upvotes: 1

Related Questions