Add Java API for non-streaming ASR (#807)

This commit is contained in:
Fangjun Kuang
2024-04-24 21:03:26 +08:00
committed by GitHub
parent c3a2e8a67c
commit 83cd533f67
24 changed files with 834 additions and 27 deletions

View File

@@ -15,19 +15,6 @@ public class OnlineRecognizer {
ptr = newFromFile(config);
}
/*
public static float[] readWavFile(String fileName) {
// read data from the filename
Object[] wavdata = readWave(fileName);
Object data = wavdata[0]; // data[0] is float data, data[1] sample rate
float[] floatData = (float[]) data;
return floatData;
}
*/
public void decode(OnlineStream s) {
decode(ptr, s.getPtr());
}
@@ -55,7 +42,7 @@ public class OnlineRecognizer {
release();
}
// recognizer release, you'd better call it manually if not use anymore
// You'd better call it manually if it is not used anymore
public void release() {
if (this.ptr == 0) {
return;