Add Flush to VAD so that the last segment can be detected. (#1099)
This commit is contained in:
@@ -491,6 +491,12 @@ typedef SherpaOnnxVoiceActivityDetectorResetNative = Void Function(
|
||||
typedef SherpaOnnxVoiceActivityDetectorReset = void Function(
|
||||
Pointer<SherpaOnnxVoiceActivityDetector>);
|
||||
|
||||
typedef SherpaOnnxVoiceActivityDetectorFlushNative = Void Function(
|
||||
Pointer<SherpaOnnxVoiceActivityDetector>);
|
||||
|
||||
typedef SherpaOnnxVoiceActivityDetectorFlush = void Function(
|
||||
Pointer<SherpaOnnxVoiceActivityDetector>);
|
||||
|
||||
typedef SherpaOnnxVoiceActivityDetectorFrontNative
|
||||
= Pointer<SherpaOnnxSpeechSegment> Function(
|
||||
Pointer<SherpaOnnxVoiceActivityDetector>);
|
||||
@@ -779,6 +785,8 @@ class SherpaOnnxBindings {
|
||||
|
||||
static SherpaOnnxVoiceActivityDetectorReset? voiceActivityDetectorReset;
|
||||
|
||||
static SherpaOnnxVoiceActivityDetectorFlush? voiceActivityDetectorFlush;
|
||||
|
||||
static SherpaOnnxCreateCircularBuffer? createCircularBuffer;
|
||||
|
||||
static SherpaOnnxDestroyCircularBuffer? destroyCircularBuffer;
|
||||
@@ -1036,6 +1044,11 @@ class SherpaOnnxBindings {
|
||||
'SherpaOnnxVoiceActivityDetectorReset')
|
||||
.asFunction();
|
||||
|
||||
voiceActivityDetectorFlush ??= dynamicLibrary
|
||||
.lookup<NativeFunction<SherpaOnnxVoiceActivityDetectorFlushNative>>(
|
||||
'SherpaOnnxVoiceActivityDetectorFlush')
|
||||
.asFunction();
|
||||
|
||||
createCircularBuffer ??= dynamicLibrary
|
||||
.lookup<NativeFunction<SherpaOnnxCreateCircularBufferNative>>(
|
||||
'SherpaOnnxCreateCircularBuffer')
|
||||
|
||||
@@ -207,6 +207,10 @@ class VoiceActivityDetector {
|
||||
SherpaOnnxBindings.voiceActivityDetectorReset?.call(ptr);
|
||||
}
|
||||
|
||||
void flush() {
|
||||
SherpaOnnxBindings.voiceActivityDetectorFlush?.call(ptr);
|
||||
}
|
||||
|
||||
Pointer<SherpaOnnxVoiceActivityDetector> ptr;
|
||||
final VadModelConfig config;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ topics:
|
||||
- voice-activity-detection
|
||||
|
||||
# remember to change the version in ../sherpa_onnx_macos/macos/sherpa_onnx_macos.podspec
|
||||
version: 1.10.11
|
||||
version: 1.10.12
|
||||
|
||||
homepage: https://github.com/k2-fsa/sherpa-onnx
|
||||
|
||||
@@ -30,19 +30,19 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
sherpa_onnx_android: ^1.10.11
|
||||
sherpa_onnx_android: ^1.10.12
|
||||
# path: ../sherpa_onnx_android
|
||||
|
||||
sherpa_onnx_macos: ^1.10.11
|
||||
sherpa_onnx_macos: ^1.10.12
|
||||
# path: ../sherpa_onnx_macos
|
||||
|
||||
sherpa_onnx_linux: ^1.10.11
|
||||
sherpa_onnx_linux: ^1.10.12
|
||||
# path: ../sherpa_onnx_linux
|
||||
#
|
||||
sherpa_onnx_windows: ^1.10.11
|
||||
sherpa_onnx_windows: ^1.10.12
|
||||
# path: ../sherpa_onnx_windows
|
||||
|
||||
sherpa_onnx_ios: ^1.10.11
|
||||
sherpa_onnx_ios: ^1.10.12
|
||||
# sherpa_onnx_ios:
|
||||
# path: ../sherpa_onnx_ios
|
||||
|
||||
|
||||
Reference in New Issue
Block a user