Add streaming CTC ASR APIs for node-addon-api (#867)

This commit is contained in:
Fangjun Kuang
2024-05-13 11:58:25 +08:00
committed by GitHub
parent db85b2c1d8
commit 384f96c40f
15 changed files with 443 additions and 29 deletions

View File

@@ -25,7 +25,6 @@ function createOnlineRecognizer() {
'numThreads': 2,
'provider': 'cpu',
'debug': 1,
'modelType': 'zipformer',
},
'decodingMethod': 'greedy_search',
'maxActivePaths': 4,
@@ -68,7 +67,7 @@ ai.on('data', data => {
}
const isEndpoint = recognizer.isEndpoint(stream);
const text = recognizer.getResult(stream).text;
const text = recognizer.getResult(stream).text.toLowerCase();
if (text.length > 0 && lastText != text) {
lastText = text;