Add CreateOnlineStreamWithHotwords to C API (#323)

* add default visibility to SHERPA_ONNX_EXPORT

* expose CreateOnlineStreamWithHotwords method via C API

Co-authored-by: Nick Fisher <nick.fisher@polyvox.app>
This commit is contained in:
Nick Fisher
2023-09-19 17:32:42 +08:00
committed by GitHub
parent d7eab95439
commit b3e9986825
2 changed files with 15 additions and 1 deletions

View File

@@ -107,6 +107,13 @@ SherpaOnnxOnlineStream *CreateOnlineStream(
return stream;
}
SherpaOnnxOnlineStream *CreateOnlineStreamWithHotwords(
const SherpaOnnxOnlineRecognizer *recognizer, const char *hotwords) {
SherpaOnnxOnlineStream *stream =
new SherpaOnnxOnlineStream(recognizer->impl->CreateStream(hotwords));
return stream;
}
void DestroyOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; }
void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate,