Skip to content

Commit 6b8b91a

Browse files
authored
Update jni.c
1 parent 667d247 commit 6b8b91a

File tree

1 file changed

+4
-4
lines changed
  • examples/whisper.android/lib/src/main/jni/whisper

1 file changed

+4
-4
lines changed

examples/whisper.android/lib/src/main/jni/whisper/jni.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_freeContext(
163163

164164
JNIEXPORT void JNICALL
165165
Java_com_whispercpp_whisper_WhisperLib_00024Companion_fullTranscribe(
166-
JNIEnv *env, jobject thiz, jlong context_ptr, jint num_threads, jfloatArray audio_data) {
166+
JNIEnv *env, jobject thiz, jlong context_ptr, jint num_threads, jfloatArray audio_data, jboolean token_timestamps, jboolean split_on_word, jint max_len) {
167167
UNUSED(thiz);
168168
struct whisper_context *context = (struct whisper_context *) context_ptr;
169169
jfloat *audio_data_arr = (*env)->GetFloatArrayElements(env, audio_data, NULL);
@@ -181,9 +181,9 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_fullTranscribe(
181181
params.offset_ms = 0;
182182
params.no_context = true;
183183
params.single_segment = false;
184-
params.token_timestamps = false; // Set true for word level timestamps
185-
params.split_on_word = false; // Set true for word level timestamps
186-
params.max_len = 1; // Set number of words in a line
184+
params.token_timestamps = token_timestamps;
185+
params.split_on_word = split_on_word;
186+
params.max_len = max_len;
187187

188188
whisper_reset_timings(context);
189189

0 commit comments

Comments
 (0)