add WebAssembly for Kws (#648)

This commit is contained in:
Lovemefan
2024-03-11 21:02:31 +08:00
committed by GitHub
parent a628002d8f
commit 009ed2cd30
14 changed files with 807 additions and 8 deletions

View File

@@ -481,7 +481,7 @@ SherpaOnnxKeywordSpotter* CreateKeywordSpotter(
SherpaOnnxKeywordSpotter* spotter = new SherpaOnnxKeywordSpotter;
spotter->impl =
std::make_unique<sherpa_onnx::KeywordSpotter>(spotter_config);
std::make_unique<sherpa_onnx::KeywordSpotter>(spotter_config);
return spotter;
}
@@ -493,7 +493,7 @@ void DestroyKeywordSpotter(SherpaOnnxKeywordSpotter* spotter) {
SherpaOnnxOnlineStream* CreateKeywordStream(
const SherpaOnnxKeywordSpotter* spotter) {
SherpaOnnxOnlineStream* stream =
new SherpaOnnxOnlineStream(spotter->impl->CreateStream());
new SherpaOnnxOnlineStream(spotter->impl->CreateStream());
return stream;
}
@@ -512,7 +512,7 @@ void DecodeMultipleKeywordStreams(
int32_t n) {
std::vector<sherpa_onnx::OnlineStream*> ss(n);
for (int32_t i = 0; i != n; ++i) {
ss[i] = streams[i]->impl.get();
ss[i] = streams[i]->impl.get();
}
spotter->impl->DecodeStreams(ss.data(), n);
}
@@ -593,7 +593,6 @@ void DestroyKeywordResult(const SherpaOnnxKeywordResult *r) {
}
}
// ============================================================
// For VAD
// ============================================================