From 6b8b91ad814ca2d51f4939b2a1eb9a9817334742 Mon Sep 17 00:00:00 2001 From: Ranjit <111440072+ranjitsingha@users.noreply.github.com> Date: Sat, 15 Feb 2025 12:00:26 +0530 Subject: [PATCH] Update jni.c --- examples/whisper.android/lib/src/main/jni/whisper/jni.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/whisper.android/lib/src/main/jni/whisper/jni.c b/examples/whisper.android/lib/src/main/jni/whisper/jni.c index 1fa8a962..e244d4ac 100644 --- a/examples/whisper.android/lib/src/main/jni/whisper/jni.c +++ b/examples/whisper.android/lib/src/main/jni/whisper/jni.c @@ -163,7 +163,7 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_freeContext( JNIEXPORT void JNICALL Java_com_whispercpp_whisper_WhisperLib_00024Companion_fullTranscribe( - JNIEnv *env, jobject thiz, jlong context_ptr, jint num_threads, jfloatArray audio_data) { + JNIEnv *env, jobject thiz, jlong context_ptr, jint num_threads, jfloatArray audio_data, jboolean token_timestamps, jboolean split_on_word, jint max_len) { UNUSED(thiz); struct whisper_context *context = (struct whisper_context *) context_ptr; jfloat *audio_data_arr = (*env)->GetFloatArrayElements(env, audio_data, NULL); @@ -181,9 +181,9 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_fullTranscribe( params.offset_ms = 0; params.no_context = true; params.single_segment = false; - params.token_timestamps = false; // Set true for word level timestamps - params.split_on_word = false; // Set true for word level timestamps - params.max_len = 1; // Set number of words in a line + params.token_timestamps = token_timestamps; + params.split_on_word = split_on_word; + params.max_len = max_len; whisper_reset_timings(context);