static int android_media_SoundPool_load_FD(JNIEnv *env, jobject thiz, jobject fileDescriptor, jlong offset, jlong length, jint priority) { ALOGV("android_media_SoundPool_load_FD"); SoundPool *ap = MusterSoundPool(env, thiz); if (ap == NULL) return 0; return ap->load(jniGetFDFromFileDescriptor(env, fileDescriptor), int64_t(offset), int64_t(length), int(priority)); }
// ---------------------------------------------------------------------------- static int android_media_SoundPool_load_URL(JNIEnv *env, jobject thiz, jstring path, jint priority) { ALOGV("android_media_SoundPool_load_URL"); SoundPool *ap = MusterSoundPool(env, thiz); if (path == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); return 0; } const char* s = env->GetStringUTFChars(path, NULL); int id = ap->load(s, priority); env->ReleaseStringUTFChars(path, s); return id; }