#!/usr/bin/env bash # https://github.com/snakers4/silero-vad/tree/master/examples/go # install onnxruntime wget https://github.com/microsoft/onnxruntime/releases/download/v1.20.1/onnxruntime-linux-x64-1.20.1.tgz tar -zxvf onnxruntime-linux-x64-1.20.1.tgz export C_INCLUDE_PATH=$C_INCLUDE_PATH:$(pwd)/onnxruntime-linux-x64-1.20.1/include export LIBRARY_PATH=$LIBRARY_PATH:$(pwd)/onnxruntime-linux-x64-1.20.1/lib #export LD_LIBRARY_PATH=$(pwd)/onnxruntime-linux-x64-1.20.1/lib:$LD_LIBRARY_PATH cp $(pwd)/onnxruntime-linux-x64-1.20.1/lib/* /usr/local/lib/ # download model # https://github.com/snakers4/silero-vad/tree/master/src/silero_vad/data wget https://github.com/snakers4/silero-vad/raw/refs/heads/master/src/silero_vad/data/silero_vad.onnx # build mkdir build go env -w GO111MODULE=on go env GO111MODULE go mod init silero go mod tidy go build -o build silero