io.github.givimad.whisperjni.WhisperContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whisper-jni Show documentation
Show all versions of whisper-jni Show documentation
A JNI wrapper for [whisper.cpp](https://github.com/ggerganov/whisper.cpp), allows to transcribe speech to text in Java
The newest version!
package io.github.givimad.whisperjni;
/**
* The {@link WhisperContext} class represents a native whisper.cpp context.
*
* You need to dispose the native memory for its instances by calling {@link #close}
* or {@link WhisperJNI#free(WhisperContext)}
*
* @author Miguel Álvarez Díez - Initial contribution
*/
public class WhisperContext extends WhisperJNI.WhisperJNIPointer {
private final WhisperJNI whisper;
/**
* Internal context constructor
* @param whisper library instance
* @param ref native pointer identifier
*/
protected WhisperContext(WhisperJNI whisper, int ref) {
super(ref);
this.whisper = whisper;
}
@Override
public void close() {
whisper.free(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy