File tree 1 file changed +15
-1
lines changed 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ This package provides Java JNI bindings for whisper.cpp. They have been tested o
8
8
9
9
The "low level" bindings are in ` WhisperCppJnaLibrary ` . The most simple usage is as follows:
10
10
11
+ JNA will attempt to load the ` whispercpp ` shared library from:
12
+
13
+ - jna.library.path
14
+ - jna.platform.library
15
+ - ~ /Library/Frameworks
16
+ - /Library/Frameworks
17
+ - /System/Library/Frameworks
18
+ - classpath
19
+
11
20
``` java
12
21
import io.github.ggerganov.whispercpp.WhisperCpp ;
13
22
@@ -19,7 +28,12 @@ public class Example {
19
28
// or you can provide the absolute path to the model file.
20
29
long context = whisper. initContext(" base.en" );
21
30
try {
22
- whisper. fullTranscribe(context, samples);
31
+ var whisperParams = whisper. getFullDefaultParams(WhisperSamplingStrategy . WHISPER_SAMPLING_GREEDY );
32
+ // custom configuration if required
33
+ whisperParams. temperature_inc = 0f ;
34
+
35
+ var samples = readAudio(); // divide each value by 32767.0f
36
+ whisper. fullTranscribe(whisperParams, samples);
23
37
24
38
int segmentCount = whisper. getTextSegmentCount(context);
25
39
for (int i = 0 ; i < segmentCount; i++ ) {
You can’t perform that action at this time.
0 commit comments