Skip to content

Commit 50d9f0b

Browse files
committed
updated README for java
1 parent cefe97b commit 50d9f0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bindings/java/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ import io.github.ggerganov.whispercpp.WhisperCpp;
1414
public class Example {
1515

1616
public static void main(String[] args) {
17-
String modelpath;
1817
WhisperCpp whisper = new WhisperCpp();
1918
// By default, models are loaded from ~/.cache/whisper/ and are usually named "ggml-${name}.bin"
2019
// or you can provide the absolute path to the model file.
21-
whisper.initContext("base.en");
22-
23-
long context = whisper.initContext(modelpath);
20+
long context = whisper.initContext("base.en");
2421
try {
2522
whisper.fullTranscribe(context, samples);
2623

@@ -47,6 +44,13 @@ cd whisper.cpp/bindings/java
4744
./gradlew build
4845
```
4946

47+
You need to have the `whisper` library in your [JNA library path](https://java-native-access.github.io/jna/4.2.1/com/sun/jna/NativeLibrary.html). On Windows the dll is included in the jar and you can update it:
48+
49+
```bash
50+
copy /y ..\..\build\bin\Release\whisper.dll build\generated\resources\main\win32-x86-64\whisper.dll
51+
```
52+
53+
5054
## License
5155

5256
The license for the Go bindings is the same as the license for the rest of the whisper.cpp project, which is the MIT License. See the `LICENSE` file for more details.

0 commit comments

Comments
 (0)