Table of Contents

Constructor AudioSegment

Namespace
LMKit.Speech
Assembly
LM-Kit.NET.dll

AudioSegment(string, string, TimeSpan, TimeSpan, float)

Creates a new AudioSegment with explicit transcript, language, timings, and confidence.

[JsonConstructor]
public AudioSegment(string text, string language, TimeSpan start, TimeSpan end, float confidence)

Parameters

text string

The recognized transcript for this segment.

language string

The BCP-47 language code of the transcript (e.g., "en", "fr").

start TimeSpan

Segment start time within the source audio.

end TimeSpan

Segment end time within the source audio.

confidence float

Confidence score for the transcription, from 0.0 (lowest) to 1.0 (highest).

Remarks

This overload is primarily used by JsonConstructorAttribute during System.Text.Json deserialization. Callers should ensure confidence is in [0.0, 1.0] and that startend. No additional validation is performed here.