Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
hantengc
2024-05-27 19:07:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-05-27 19:07:26 +0800
Commit
1371c6b3f08e33784380f9cd76832bdf83c166bf
1371c6b3
1 parent
49ea59d4
提供设置关键词的api,方便动态调整关键词来进行识别 (#923)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
17 行增加
和
0 行删除
sherpa-onnx/c-api/c-api.cc
sherpa-onnx/c-api/c-api.h
sherpa-onnx/c-api/c-api.cc
查看文件 @
1371c6b
...
...
@@ -561,6 +561,13 @@ SherpaOnnxOnlineStream *CreateKeywordStream(
return
stream
;
}
SherpaOnnxOnlineStream
*
CreateKeywordStreamWithKeywords
(
const
SherpaOnnxKeywordSpotter
*
spotter
,
const
char
*
keywords
)
{
SherpaOnnxOnlineStream
*
stream
=
new
SherpaOnnxOnlineStream
(
spotter
->
impl
->
CreateStream
(
keywords
));
return
stream
;
}
int32_t
IsKeywordStreamReady
(
SherpaOnnxKeywordSpotter
*
spotter
,
SherpaOnnxOnlineStream
*
stream
)
{
return
spotter
->
impl
->
IsReady
(
stream
->
impl
.
get
());
...
...
sherpa-onnx/c-api/c-api.h
查看文件 @
1371c6b
...
...
@@ -583,6 +583,16 @@ SHERPA_ONNX_API void DestroyKeywordSpotter(SherpaOnnxKeywordSpotter *spotter);
SHERPA_ONNX_API
SherpaOnnxOnlineStream
*
CreateKeywordStream
(
const
SherpaOnnxKeywordSpotter
*
spotter
);
/// Create an online stream for accepting wave samples with the specified hot
/// words.
///
/// @param spotter A pointer returned by CreateKeywordSpotter()
/// @param keywords A pointer points to the keywords that you set
/// @return Return a pointer to an OnlineStream. The user has to invoke
/// DestroyOnlineStream() to free it to avoid memory leak.
SHERPA_ONNX_API
SherpaOnnxOnlineStream
*
CreateKeywordStreamWithKeywords
(
const
SherpaOnnxKeywordSpotter
*
spotter
,
const
char
*
keywords
);
/// Return 1 if there are enough number of feature frames for decoding.
/// Return 0 otherwise.
///
...
...
请
注册
或
登录
后发表评论