Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.4 KB

README.md

File metadata and controls

96 lines (71 loc) · 2.4 KB


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