Add vad clear api for better performance (#366)

* Add vad clear api for better performance

* rename to make naming consistent and remove macro

* Fix linker error

* Fix Vad.kt
This commit is contained in:
yujinqiu
2023-10-16 14:40:47 +08:00
committed by GitHub
parent 55b6893885
commit d01682d968
9 changed files with 55 additions and 25 deletions

View File

@@ -551,7 +551,7 @@ class SherpaOnnxVoiceActivityDetectorWrapper {
return SherpaOnnxVoiceActivityDetectorEmpty(vad) == 1
}
func isDetected() -> Bool {
func isSpeechDetected() -> Bool {
return SherpaOnnxVoiceActivityDetectorDetected(vad) == 1
}
@@ -559,6 +559,10 @@ class SherpaOnnxVoiceActivityDetectorWrapper {
SherpaOnnxVoiceActivityDetectorPop(vad)
}
func clear() {
SherpaOnnxVoiceActivityDetectorClear(vad)
}
func front() -> SherpaOnnxSpeechSegmentWrapper {
let p: UnsafePointer<SherpaOnnxSpeechSegment>? = SherpaOnnxVoiceActivityDetectorFront(vad)
return SherpaOnnxSpeechSegmentWrapper(p: p)