close
Skip to content

WiseSync/silero_vad_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voice Activity Detection for C++

Overview

This package aims to provide an accurate, user-friendly voice activity detector (VAD) that runs in the C++. It runs Silero VAD [1] using ONNX Runtime C++.

Requirements

Code are tested in the environments bellow, feel free to try others.

  • C++ 17 or above
  • onnxruntime-1.12.1 or above
  • cmake-3.5 or above
  • SDL2 or above for examples

Quick Start

To use the VAD via a script tag in the browser, include the following script tags:

#include <silero_vad/vad.hpp>

silero_vad::SileroVAD vad("model/silero_vad.onnx");
std::vector<float> input_wav(vad.GetFrameSamples(), 0.0f);
bool running = true;

while(running){
  //Fill input_wav with audio samples
  bool b = vad.Detect(input_wav);
  if(b){
    //Detect voice activity in this frame
  }else{
    //No voice activity in this frame
  }
}

Build Examples

#Install dependencies
brew install onnxruntime
brew install sdl2

cd {silero_vad_cpp}
# Build the example
mkdir build
cd build
cmake ..
make
cd ..
# Run the example
./build/silero_vad_cpp_example

References

[1] Silero Team. (2021). Silero VAD: pre-trained enterprise-grade Voice Activity Detector (VAD), Number Detector and Language Classifier. GitHub, GitHub repository, https://github.com/snakers4/silero-vad, hello@silero.ai.

About

The CPP version of Silero VAD: pre-trained enterprise-grade Voice Activity Detector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors