From 17c8237ee409b74544a064cc999d8d3098cc5d97 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 26 Aug 2024 10:18:48 +0800 Subject: [PATCH] Fix releasing npm package and fix building Android VAD+ASR example (#1288) --- .../app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt | 5 ++--- scripts/nodejs/.gitignore | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 scripts/nodejs/.gitignore diff --git a/android/SherpaOnnxVadAsr/app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt b/android/SherpaOnnxVadAsr/app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt index fd7d60280..fb14d072d 100644 --- a/android/SherpaOnnxVadAsr/app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt +++ b/android/SherpaOnnxVadAsr/app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt @@ -174,9 +174,8 @@ class MainActivity : AppCompatActivity() { vad.acceptWaveform(samples) while(!vad.empty()) { - var objArray = vad.front() - val samples = objArray[1] as FloatArray - val text = runSecondPass(samples) + var segment = vad.front() + val text = runSecondPass(segment.samples) if (text.isNotBlank()) { lastText = "${lastText}\n${idx}: ${text}" diff --git a/scripts/nodejs/.gitignore b/scripts/nodejs/.gitignore deleted file mode 100644 index 075c52da9..000000000 --- a/scripts/nodejs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -jslint.mjs -sherpa-onnx-*.js -sherpa-onnx-*.wasm