-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathwhispercpp.java
executable file
·33 lines (24 loc) · 1.16 KB
/
whispercpp.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//TODO: re-write entire whispercpp.java with standard Android JNI specification
// interaction between KANTVMgr.java and whispercpp.java
package org.ggml.whispercpp;
public class whispercpp {
private static final String TAG = whispercpp.class.getName();
public static final int WHISPER_ASR_MODE_NORMAL = 0;
public static final int WHISPER_ASR_MODE_PRESURETEST = 1;
public static final int WHISPER_ASR_MODE_BECHMARK = 2;
public static native void asr_init(String strModelPath, int nThreadCounts, int nDevMode);
public static native void asr_finalize();
public static native String get_systeminfo();
public static native int get_cpu_core_counts();
//TODO: not work as expected, just skip this during PoC stage
public static native void set_benchmark_status(int bExitBenchmark);
/**
*
* @param modelPath /sdcard/kantv/ggml-xxxxx.bin
* @param audioPath /sdcard/kantv/jfk.wav
* @param nBenchType 0: asr 1: memcpy 2: mulmat 3: full/whisper_encode
* @param nThreadCounts 1 - 8
* @return
*/
public static native String bench(String modelPath, String audioPath, int nBenchType, int nThreadCounts);
}