Add Flush to VAD so that the last segment can be detected. (#1099)

This commit is contained in:
Fangjun Kuang
2024-07-09 16:15:56 +08:00
committed by GitHub
parent 3e4307e2fb
commit c2cc9dec58
35 changed files with 237 additions and 29 deletions

View File

@@ -53,6 +53,11 @@ namespace SherpaOnnx
SherpaOnnxVoiceActivityDetectorReset(_handle.Handle);
}
public void Flush()
{
SherpaOnnxVoiceActivityDetectorFlush(_handle.Handle);
}
public void Dispose()
{
Cleanup();
@@ -106,5 +111,7 @@ namespace SherpaOnnx
[DllImport(Dll.Filename)]
private static extern void SherpaOnnxVoiceActivityDetectorReset(IntPtr handle);
[DllImport(Dll.Filename)]
private static extern void SherpaOnnxVoiceActivityDetectorFlush(IntPtr handle);
}
}