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
yujinqiu
2023-10-12 15:11:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-10-12 15:11:58 +0800
Commit
f6566c8ace69e7121d0bbea76ebbb4350ff9dfa4
f6566c8a
1 parent
32da5ecf
Expose VAD isDetected api to Swift (#356)
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
15 行增加
和
1 行删除
sherpa-onnx/c-api/c-api.cc
sherpa-onnx/c-api/c-api.h
swift-api-examples/SherpaOnnx.swift
sherpa-onnx/c-api/c-api.cc
查看文件 @
f6566c8
...
...
@@ -488,6 +488,11 @@ int32_t SherpaOnnxVoiceActivityDetectorEmpty(
return
p
->
impl
->
Empty
();
}
int32_t
SherpaOnnxVoiceActivityDetectorDetected
(
SherpaOnnxVoiceActivityDetector
*
p
)
{
return
p
->
impl
->
IsSpeechDetected
();
}
SHERPA_ONNX_API
void
SherpaOnnxVoiceActivityDetectorPop
(
SherpaOnnxVoiceActivityDetector
*
p
)
{
p
->
impl
->
Pop
();
...
...
sherpa-onnx/c-api/c-api.h
查看文件 @
f6566c8
...
...
@@ -570,6 +570,11 @@ SHERPA_ONNX_API void SherpaOnnxVoiceActivityDetectorAcceptWaveform(
SHERPA_ONNX_API
int32_t
SherpaOnnxVoiceActivityDetectorEmpty
(
SherpaOnnxVoiceActivityDetector
*
p
);
// Return 1 if there is voice detected.
// Return 0 if voice is silent.
SHERPA_ONNX_API
int32_t
SherpaOnnxVoiceActivityDetectorDetected
(
SherpaOnnxVoiceActivityDetector
*
p
);
// Return the first speech segment.
// It throws if SherpaOnnxVoiceActivityDetectorEmpty() returns 1.
SHERPA_ONNX_API
void
SherpaOnnxVoiceActivityDetectorPop
(
...
...
swift-api-examples/SherpaOnnx.swift
查看文件 @
f6566c8
...
...
@@ -548,7 +548,11 @@ class SherpaOnnxVoiceActivityDetectorWrapper {
}
func
isEmpty
()
->
Bool
{
return
SherpaOnnxVoiceActivityDetectorEmpty
(
vad
)
==
1
?
true
:
false
return
SherpaOnnxVoiceActivityDetectorEmpty
(
vad
)
==
1
}
func
isDetected
()
->
Bool
{
return
SherpaOnnxVoiceActivityDetectorDetected
(
vad
)
==
1
}
func
pop
()
{
...
...
请
注册
或
登录
后发表评论