aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-10-08 09:02:54 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-10-08 09:02:54 +0200
commit978aa89541181c7e5b114589fac686a96702d371 (patch)
tree5dd902164af651c8029be43332c2fe6e932e674e /README.md
parenta5af9c3d351085f4005a949f8c382a3aad4e0b29 (diff)
downloadsvad-master.tar.gz
svad-master.zip
Add command-line toolHEADv0.1.1master
Diffstat (limited to '')
-rw-r--r--README.md33
1 files changed, 29 insertions, 4 deletions
diff --git a/README.md b/README.md
index 88f135e..0199fd5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# svad
-Voice activity detection library using [Silero VAD](https://github.com/snakers4/silero-vad) v6.2 weights. Supports mono 16 kHz and 8 kHz audio, speech probabilities, and speech segmentation.
+Voice activity detection using [Silero VAD](https://github.com/snakers4/silero-vad) v6.2 weights. Supports mono 16 kHz and 8 kHz audio, speech probabilities, and speech segmentation.
## Build
@@ -28,17 +28,42 @@ cp build/generated/src/weights_16k.h build/generated/src/weights_8k.h .
The script also creates `build/generated/svad_weights.bin`. You only need that file if you use `svad_create_from_file` to load weights at run time.
-### Build the library
+### Build the library and command
```sh
-make # builds libsvad.a
+make # builds libsvad.a and svad
make debug # optional debug build
make clean # removes build outputs
```
Link your application with `libsvad.a` and `-lm`.
-## Usage
+## Command-line usage
+
+`svad` reads a 16-bit PCM WAV file at 8 kHz or 16 kHz. Multichannel audio is downmixed to mono. It prints speech start/end times in seconds and sample positions.
+
+```sh
+./svad audio.wav
+./svad --json --quiet audio.wav > segments.json
+./svad --stream audio.wav
+```
+
+Usage:
+
+```text
+svad [--stream] [--probs FILE] [--json] [--quiet]
+ [--threshold X] [--neg-threshold X] [--min-speech-ms N]
+ [--max-speech-s X] [--min-silence-ms N] [--speech-pad-ms N]
+ [--weights FILE] [--scalar] [--dense-stft] [--no-ftz] INPUT.wav
+```
+
+* `--stream` prints speech start/end events while processing the file.
+* `--json` formats offline segments as JSON. `--quiet` suppresses statistics.
+* `--probs FILE` saves one native float32 probability per 32 ms chunk.
+
+Use `--help` to display the available options.
+
+## Library usage
Save this example as `example.c`. It reads raw mono signed 16-bit PCM in native byte order from standard input at 16 kHz and prints one speech probability per 32 ms chunk. Input must already be decoded and resampled; WAV headers are not accepted.