Skip to content

Commit 57543c1

Browse files
committed
updated java README
1 parent 5b9e59b commit 57543c1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

bindings/java/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ This package provides Java JNI bindings for whisper.cpp. They have been tested o
88

99
The "low level" bindings are in `WhisperCppJnaLibrary`. The most simple usage is as follows:
1010

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+
1120
```java
1221
import io.github.ggerganov.whispercpp.WhisperCpp;
1322

@@ -19,7 +28,12 @@ public class Example {
1928
// or you can provide the absolute path to the model file.
2029
long context = whisper.initContext("base.en");
2130
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);
2337

2438
int segmentCount = whisper.getTextSegmentCount(context);
2539
for (int i = 0; i < segmentCount; i++) {

0 commit comments

Comments
 (0)