File: test_vad.rb

package info (click to toggle)
whisper.cpp 1.8.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 32,228 kB
  • sloc: cpp: 188,765; ansic: 121,729; lisp: 10,221; sh: 4,272; objc: 2,159; ruby: 1,682; python: 1,177; javascript: 594; makefile: 144
file content (19 lines) | stat: -rw-r--r-- 486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require_relative "helper"

class TestVAD < TestBase
  def setup
    @whisper = Whisper::Context.new("base.en")
    vad_params = Whisper::VAD::Params.new
    @params = Whisper::Params.new(
      vad: true,
      vad_model_path: "silero-v6.2.0",
      vad_params:
    )
  end

  def test_transcribe
    @whisper.transcribe(TestBase::AUDIO, @params) do |text|
      assert_match(/ask not what your country can do for you[,.] ask what you can do for your country/i, text)
    end
  end
end