API reference · Kjarni 0.2.7
Class Transcriber
Namespace: Kjarni
Assembly: Kjarni.dll
Speech to text with Whisper.
public class Transcriber : IDisposable
Inheritance
Implements
Examples
using var transcriber = new Transcriber(language: "en");
var t = transcriber.TranscribeFile("meeting.wav");
Console.WriteLine(t.Text);
Constructors
Transcriber(string?, string?, bool, string, bool)
Load a Whisper model, downloading it on first use.
public Transcriber(string? model = null, string? language = null, bool translate = false, string device = "cpu", bool quiet = false)
Parameters
model string?
Model name, e.g. "whisper-small" (the default) or "whisper-large-v3".
language string?
ISO code such as "en" or "is"; null detects it from the audio.
translate bool
Translate the speech into English instead of transcribing it.
device string
Compute device - "cpu" or "gpu".
quiet bool
Suppress progress output.
Methods
Dispose()
Releases the native model. The object cannot be used afterwards.
public void Dispose()
~Transcriber()
Releases the native model if
protected ~Transcriber()
Transcribe(float[], int)
Transcribe mono samples in -1..1 at any sample rate; they are resampled to 16 kHz.
public Transcript Transcribe(float[] samples, int sampleRate)
Parameters
samples float[]
sampleRate int
Returns
TranscribeFile(string)
Transcribe a wav, mp3, flac or ogg file.
public Transcript TranscribeFile(string path)
Parameters
path string
Returns
Kjarni runs the same engine on every platform: