Property VadSettings
VadSettings
Configuration for voice-activity detection.
Used only when EnableVoiceActivityDetection is true.
If you set this to null, defaults will be reapplied.
public VadSettings VadSettings { get; set; }
Property Value
Examples
using LMKit.Model;
using LMKit.Speech;
using LMKit.Media.Audio;
using System;
// Load a Whisper model
LM model = LM.LoadFromModelID("whisper-large-turbo3");
// Create the speech-to-text engine
var engine = new SpeechToText(model);
// Enable VAD with custom settings
engine.EnableVoiceActivityDetection = true;
engine.VadSettings = new VadSettings
{
Threshold = 0.5f,
MinSpeechDurationMs = 250,
MinSilenceDurationMs = 100
};
// Transcribe - only speech portions will be processed
var result = engine.Transcribe(new WaveFile("audio.wav"));
foreach (var segment in result.Segments)
{
Console.WriteLine($"[{segment.Start:mm\\:ss} - {segment.End:mm\\:ss}] {segment.Text}");
}