Skip to content

VAD not working with go on a particular wav file (48 kHz, stereo) #536

Answered by streamer45
fear-the-reaper asked this question in Q&A
Discussion options

You must be logged in to vote

@fear-the-reaper The file you shared has a couple of issues:

  • Samplerate is 48kHz. The library assumes 16kHz
  • It's stereo audio. The library assumes mono.

After fixing the input file with ffmpeg -i test.wav -ar 16000 -ac 1 test_fixed.wav, I can get it to work:

go run ./cmd/main.go test_fixed.wav 
2024/09/04 17:12:47 speech starts at 0.93s
2024/09/04 17:12:47 speech ends at 2.46s
2024/09/04 17:12:47 speech starts at 2.91s
2024/09/04 17:12:47 speech ends at 4.67s
2024/09/04 17:12:47 speech starts at 4.86s
2024/09/04 17:12:47 speech ends at 5.18s
2024/09/04 17:12:47 speech starts at 5.50s
2024/09/04 17:12:47 speech ends at 5.76s
2024/09/04 17:12:47 speech starts at 5.89s
2024/09/04 17:12:47 …

Replies: 9 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@snakers4
Comment options

Answer selected by snakers4
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
3 participants
Converted from issue

This discussion was converted from issue #535 on September 05, 2024 03:25.