Add keyword spotting API for node-addon-api (#877)

This commit is contained in:
Fangjun Kuang
2024-05-14 20:26:48 +08:00
committed by GitHub
parent 75630b986b
commit 03c956a317
18 changed files with 492 additions and 26 deletions

View File

@@ -625,6 +625,13 @@ SHERPA_ONNX_API const SherpaOnnxKeywordResult *GetKeywordResult(
/// @param r A pointer returned by GetKeywordResult()
SHERPA_ONNX_API void DestroyKeywordResult(const SherpaOnnxKeywordResult *r);
// the user has to call FreeKeywordResultJson() to free the returned pointer
// to avoid memory leak
SHERPA_ONNX_API const char *GetKeywordResultAsJson(
SherpaOnnxKeywordSpotter *spotter, SherpaOnnxOnlineStream *stream);
SHERPA_ONNX_API void FreeKeywordResultJson(const char *s);
// ============================================================
// For VAD
// ============================================================