Add VAD example for Dart API (#996)

This commit is contained in:
Fangjun Kuang
2024-06-14 10:37:16 +08:00
committed by GitHub
parent c214d8fb74
commit d08cc04567
33 changed files with 883 additions and 142 deletions

View File

@@ -0,0 +1,21 @@
# Introduction
This example shows how to use the Dart API from sherpa-onnx for voice activity detection (VAD).
Specifically, we use VAD to remove silences from a wave file.
# Usage
```bash
dart pub get
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/lei-jun-test.wav
dart run \
./bin/vad.dart \
--silero-vad ./silero_vad.onnx \
--input-wav ./lei-jun-test.wav \
--output-wav ./lei-jun-test-no-silence.wav
```
It should generate a file `lei-jun-test-no-silence.wav`, where silences are removed.