I've problem with loading mp3 file. when I give char array or jstring parameter to android java native method, c source file doesn't work.
maybe path parameter is not working correctly. what's wrong with it?
please answer to my question.
main.c
void Java_com_chocolate_player_PlayerMain_cPlaySound(JNIEnv env, jobject thiz, const char path) { FMOD_RESULT result = FMOD_OK;
result = FMOD_System_CreateSound(gSystem, path, FMOD_CREATECOMPRESSEDSAMPLE | FMOD_OPENMEMORY, 0, &gSound);
CHECK_RESULT(result);
__android_log_write(ANDROID_LOG_INFO, "path", path);
result = FMOD_System_PlaySound(gSystem, FMOD_CHANNEL_FREE, gSound, 0, &gChannel);
CHECK_RESULT(result);
}
android java source
in play method ... char[] fmodPath = songPath.replace("/mnt", "").toCharArray(); cPlaySound(fmodPath);
native method ... public native void cPlaySound(char[] path);