Skip to content

Commit cc5c81d

Browse files
committed
Add document on VAD in README
1 parent f885eaa commit cc5c81d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

bindings/ruby/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,22 @@ whisper
324324
325325
The second argument `samples` may be an array, an object with `length` and `each` method, or a MemoryView. If you can prepare audio data as C array and export it as a MemoryView, whispercpp accepts and works with it with zero copy.
326326
327+
Using VAD separately from ASR
328+
-----------------------------
329+
330+
VAD feature itself is useful. You can use it separately from ASR:
331+
332+
```ruby
333+
vad = Whisper::VAD::Context.new("silero-v5.1.2")
334+
vad
335+
.detect("path/to/audio.wav", Whisper::VAD::Params.new)
336+
.each_with_index do |segment, index|
337+
segment => {start_time: st, end_time: ed} # `Segment` responds to `#deconstruct_keys`
338+
339+
puts "[%{nth}: %{st} --> %{ed}]" % {nth: index + 1, st:, ed:}
340+
end
341+
```
342+
327343
Development
328344
-----------
329345

0 commit comments

Comments
 (0)