Skip to content

A Golang (CGO) implementation of a Silero VAD powered speech detector

License

Notifications You must be signed in to change notification settings

cevin/silero-vad-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


silero-vad-go

A simple Golang (CGO + ONNX Runtime) speech detector powered by Silero VAD

Go Reference License: MIT


Requirements

  • Golang >= v1.21
  • A C compiler (e.g. GCC)
  • ONNX Runtime (v1.18.1)
  • A Silero VAD model (v5)

Development

This repository is cloned from streamer45/silero-vad-go. Based on the original version, the introduction of onnxruntime dependency is modified to be through pkg-config, the purpose is to make it more convenient to use.

Linux

Install
# install pkg-config tool
## rhel ( or other rpm based distro version )
dnf install pkg-config
## debian ( or other deb based distro version )
apt install pkg-config

# install onnxruntime
## download onnxruntime
OV=1.20.1
ARCH="x64"
wget https://github.com/microsoft/onnxruntime/releases/download/v${OV}/onnxruntime-linux-${ARCH}-${OV}.tgz
## install
tar xf onnxruntime-linux-${ARCH}-${OV}.tgz
mv onnxruntime-linux-${ARCH}-${OV} /usr/local/onnxruntime
## Generate pc (pkg-config) file
mkdir -p /usr/local/share/pkgconfig
cp /usr/local/onnxruntime/lib/pkgconfig/libonnxruntime.pc /usr/local/share/pkgconfig/

sed -i "s/\/usr\/local/\/usr\/local\/onnxruntime/g" /usr/local/share/pkgconfig/libonnxruntime.pc
sed -i "s/\/lib64/\/lib/g" /usr/local/share/pkgconfig/libonnxruntime.pc
sed -i "s/\/include\/onnxruntime/\/include/g" /usr/local/share/pkgconfig/libonnxruntime.pc
echo "/usr/local/onnxruntime/lib" > /etc/ld.so.conf.d/libonnxruntime.conf
ldconfig

# done
Verify

Darwin (MacOS)

Install
brew install onnxruntime pkgconfig
Verify
pkg-config --libs libonnxruntime

libonnxruntime.pc

prefix=/usr/local/onnxruntime
bindir=${prefix}/bin
mandir=${prefix}/share/man
docdir=${prefix}/share/doc/onnxruntime
libdir=${prefix}/lib
includedir=${prefix}/include

Name: onnxruntime
Description: ONNX runtime
URL: https://github.com/microsoft/onnxruntime
Version: 1.20.1
Libs: -L${libdir} -lonnxruntime
Cflags: -I${includedir}

License

MIT License - see LICENSE for full text

About

A Golang (CGO) implementation of a Silero VAD powered speech detector

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 78.7%
  • C 19.9%
  • Makefile 1.4%