Property Mode
Mode
Gets or sets the operating mode: whether to transcribe in the source language or translate into English.
public SpeechToText.SpeechToTextMode Mode { 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);
// Set mode to translate foreign audio into English
engine.Mode = SpeechToTextMode.Translation;
// Transcribe French audio - output will be in English
var result = engine.Transcribe(new WaveFile("french_audio.wav"));
foreach (var segment in result.Segments)
{
Console.WriteLine(segment.Text);
}
Remarks
When set to Transcription (default), the engine produces text in the original spoken language. When set to Translation, the engine translates the spoken content into English regardless of the source language.