Agent Skillsbenchflow-ai/skillsbench › Voice Activity Detection (VAD)

Voice Activity Detection (VAD)

GitHub

用于在音频中检测语音片段,过滤静音和噪声。支持 Silero、SpeechBrain 和 WebRTC 等工具,适用于说话人日志预处理、音频分段及提升 diarization 准确率,并提供边界后处理逻辑。

tasks-extra/speaker-diarization-subtitles/environment/skills/voice-activity-detection/SKILL.md benchflow-ai/skillsbench

Trigger Scenarios

音频预处理 说话人日志 过滤静音 音频分段

Install

npx skills add benchflow-ai/skillsbench --skill Voice Activity Detection (VAD) -g -y
More Options

Non-standard path

npx skills add https://github.com/benchflow-ai/skillsbench/tree/main/tasks-extra/speaker-diarization-subtitles/environment/skills/voice-activity-detection -g -y

Use without installing

npx skills use benchflow-ai/skillsbench@Voice Activity Detection (VAD)

指定 Agent (Claude Code)

npx skills add benchflow-ai/skillsbench --skill Voice Activity Detection (VAD) -a claude-code -g -y

安装 repo 全部 skill

npx skills add benchflow-ai/skillsbench --all -g -y

预览 repo 内 skill

npx skills add benchflow-ai/skillsbench --list

SKILL.md

Frontmatter
{
    "name": "Voice Activity Detection (VAD)",
    "description": "Detect speech segments in audio using VAD tools like Silero VAD, SpeechBrain VAD, or WebRTC VAD. Use when preprocessing audio for speaker diarization, filtering silence, or segmenting audio into speech chunks. Choose Silero VAD for short segments, SpeechBrain VAD for general purpose, or WebRTC VAD for lightweight applications."
}

Voice Activity Detection (VAD)

Overview

Voice Activity Detection identifies which parts of an audio signal contain speech versus silence or background noise. This is a critical first step in speaker diarization pipelines.

When to Use

  • Preprocessing audio before speaker diarization
  • Filtering out silence and noise
  • Segmenting audio into speech chunks
  • Improving diarization accuracy by focusing on speech regions

Available VAD Tools

1. Silero VAD (Recommended for Short Segments)

Best for: Short audio segments, real-time applications, better detection of brief speech

import torch

# Load Silero VAD model
model, utils = torch.hub.load(
    repo_or_dir='snakers4/silero-vad',
    model='silero_vad',
    force_reload=False,
    onnx=False
)
get_speech_timestamps = utils[0]

# Run VAD
speech_timestamps = get_speech_timestamps(
    waveform[0],  # mono audio waveform
    model,
    threshold=0.6,  # speech probability threshold
    min_speech_duration_ms=350,  # minimum speech segment length
    min_silence_duration_ms=400,  # minimum silence between segments
    sampling_rate=sample_rate
)

# Convert to boundaries format
boundaries = [[ts['start'] / sample_rate, ts['end'] / sample_rate]
              for ts in speech_timestamps]

Advantages:

  • Better at detecting short speech segments
  • Lower false alarm rate
  • Optimized for real-time processing

2. SpeechBrain VAD

Best for: General-purpose VAD, longer audio files

from speechbrain.inference.VAD import VAD

VAD_model = VAD.from_hparams(
    source="speechbrain/vad-crdnn-libriparty",
    savedir="/tmp/speechbrain_vad"
)

# Get speech segments
boundaries = VAD_model.get_speech_segments(audio_path)

Advantages:

  • Well-tested and reliable
  • Good for longer audio files
  • Part of comprehensive SpeechBrain toolkit

3. WebRTC VAD

Best for: Lightweight applications, real-time processing

import webrtcvad

vad = webrtcvad.Vad(2)  # Aggressiveness: 0-3 (higher = more aggressive)

# Process audio frames (must be 10ms, 20ms, or 30ms)
is_speech = vad.is_speech(frame_bytes, sample_rate)

Advantages:

  • Very lightweight
  • Fast processing
  • Good for real-time applications

Postprocessing VAD Boundaries

After VAD, you should postprocess boundaries to:

  • Merge close segments
  • Remove very short segments
  • Smooth boundaries
def postprocess_boundaries(boundaries, min_dur=0.30, merge_gap=0.25):
    """
    boundaries: list of [start_sec, end_sec]
    min_dur: drop segments shorter than this (sec)
    merge_gap: merge segments if silence gap <= this (sec)
    """
    # Sort by start time
    boundaries = sorted(boundaries, key=lambda x: x[0])

    # Remove short segments
    boundaries = [(s, e) for s, e in boundaries if (e - s) >= min_dur]

    # Merge close segments
    merged = [list(boundaries[0])]
    for s, e in boundaries[1:]:
        prev_s, prev_e = merged[-1]
        if s - prev_e <= merge_gap:
            merged[-1][1] = max(prev_e, e)
        else:
            merged.append([s, e])

    return merged

Choosing the Right VAD

Tool Best For Pros Cons
Silero VAD Short segments, real-time Better short-segment detection Requires PyTorch
SpeechBrain VAD General purpose Reliable, well-tested May miss short segments
WebRTC VAD Lightweight apps Fast, lightweight Less accurate, requires specific frame sizes

Common Issues and Solutions

  1. Too many false alarms: Increase threshold or min_speech_duration_ms
  2. Missing short segments: Use Silero VAD or decrease threshold
  3. Over-segmentation: Increase merge_gap in postprocessing
  4. Missing speech at boundaries: Decrease min_silence_duration_ms

Integration with Speaker Diarization

VAD boundaries are used to:

  1. Extract speech segments for speaker embedding extraction
  2. Filter out non-speech regions
  3. Improve clustering by focusing on actual speech
# After VAD, extract embeddings only for speech segments
for start, end in vad_boundaries:
    segment_audio = waveform[:, int(start*sr):int(end*sr)]
    embedding = speaker_model.encode_batch(segment_audio)
    # ... continue with clustering

Version History

  • 9a1f4dd Current 2026-07-24 16:38

Same Skill Collection

.agents/skills/skill-creator/SKILL.md
.agents/skills/skillsbench/SKILL.md
.agents/skills/task-creator/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/ebcdic-overpunch-decoding/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gl-posting-codes/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pdf/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/rdkit/SKILL.md
tasks-extra/gh-repo-analytics/environment/skills/gh-cli/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/multi-resource-allocation-validation/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/online-resource-scheduling/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/mhc-algorithm/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/nanogpt-training/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/nda-clause-taxonomy/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/xlsx-parsing/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-count-in-video/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-video-understanding/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gpt-multimodal/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/video-frame-extraction/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/audiobook/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/elevenlabs-tts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/gtts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/openai-tts/SKILL.md
tasks-extra/scheduling-email-assistant/environment/skills/gmail-skill/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/automatic-speech-recognition/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/multimodal-fusion/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/speaker-clustering/SKILL.md
tasks-extra/taxonomy-tree-merge/environment/skills/hierarchical-taxonomy-clustering/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/ffmpeg-video-editing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/filler-word-processing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/whisper-transcription/SKILL.md
tasks-extra/video-tutorial-indexer/environment/skills/speech-to-text/SKILL.md
tasks/3d-scan-calc/environment/skills/mesh-analysis/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/ada-plan-view-accessibility/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/architectural-dxf-extraction/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/geometric-layout-repair/SKILL.md
tasks/adaptive-cruise-control/environment/skills/csv-processing/SKILL.md
tasks/adaptive-cruise-control/environment/skills/pid-controller/SKILL.md
tasks/adaptive-cruise-control/environment/skills/simulation-metrics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/vehicle-dynamics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/yaml-config/SKILL.md
tasks/azure-bgp-oscillation-route-leak/environment/skills/azure-bgp/SKILL.md
tasks/bike-rebalance/environment/skills/geospatial-routing-data/SKILL.md

Metadata

Files
0
Version
9a1f4dd
Hash
f0af8b14
Indexed
2026-07-24 16:38

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-08 00:52
浙ICP备14020137号-1 $방문자$