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

@@ -65,6 +65,12 @@ void main(List<String> arguments) async {
}
}
vad.flush();
while (!vad.isEmpty()) {
allSamples.add(vad.front().samples);
vad.pop();
}
vad.free();
final s = Float32List.fromList(allSamples.expand((x) => x).toList());

View File

@@ -9,7 +9,7 @@ environment:
sdk: ^3.4.0
dependencies:
sherpa_onnx: ^1.10.11
sherpa_onnx: ^1.10.12
path: ^1.9.0
args: ^2.5.0