Skip to content

Commit

Permalink
Merge pull request #489 from streamer45/update-golang-example
Browse files Browse the repository at this point in the history
Update Golang example to support model v5
  • Loading branch information
adamnsandle authored Jul 8, 2024
2 parents fdbb0a3 + 24f5164 commit 3888946
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion examples/go/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ func main() {
sd, err := speech.NewDetector(speech.DetectorConfig{
ModelPath: "../../files/silero_vad.onnx",
SampleRate: 16000,
WindowSize: 1536,
Threshold: 0.5,
MinSilenceDurationMs: 0,
SpeechPadMs: 0,
Expand All @@ -22,6 +21,10 @@ func main() {
log.Fatalf("failed to create speech detector: %s", err)
}

if len(os.Args) != 2 {
log.Fatalf("invalid arguments provided: expecting one file path")
}

f, err := os.Open(os.Args[1])
if err != nil {
log.Fatalf("failed to open sample audio file: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion examples/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.4

require (
github.com/go-audio/wav v1.1.0
github.com/streamer45/silero-vad-go v0.1.0
github.com/streamer45/silero-vad-go v0.2.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions examples/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/go-audio/wav v1.1.0 h1:jQgLtbqBzY7G+BM8fXF7AHUk1uHUviWS4X39d5rsL2g=
github.com/go-audio/wav v1.1.0/go.mod h1:mpe9qfwbScEbkd8uybLuIpTgHyrISw/OTuvjUW2iGtE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/streamer45/silero-vad-go v0.1.0 h1:0nGZ6VT3LKOkBG/w+4kljIB6brxtgQn6YuNjTVYjOQ4=
github.com/streamer45/silero-vad-go v0.1.0/go.mod h1:B+2FXs/5fZ6pzl6unUZYhZqkYdOB+3saBVzjOzdZnUs=
github.com/streamer45/silero-vad-go v0.2.0 h1:bbRTa6cQuc7VI88y0qicx375UyWoxE6wlVOF+mUg0+g=
github.com/streamer45/silero-vad-go v0.2.0/go.mod h1:B+2FXs/5fZ6pzl6unUZYhZqkYdOB+3saBVzjOzdZnUs=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down

0 comments on commit 3888946

Please sign in to comment.