vad_helper_test.go 573 B

12345678910111213141516171819202122232425
  1. package vad
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
  4. "path/filepath"
  5. "testing"
  6. )
  7. func TestGetVADInfo(t *testing.T) {
  8. var audioInfo = AudioInfo{
  9. FileFullPath: filepath.Join(unit_test_helper.GetTestDataResourceRootPath([]string{"ffmpeg", "org"}, 4, false), "sampleAudio.wav"),
  10. // check below accordingly
  11. SampleRate: 16000,
  12. BitDepth: 16,
  13. }
  14. vadInfos, err := GetVADInfoFromAudio(audioInfo, false)
  15. if err != nil {
  16. t.Fatal(err)
  17. }
  18. println(vadInfos[0].Time.Milliseconds())
  19. println(vadInfos[1].Time.Milliseconds())
  20. }