Constructor AudioSegment
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
stringThe recognized transcript for this segment.
language
stringThe BCP-47 language code of the transcript (e.g., "en", "fr").
start
TimeSpanSegment start time within the source audio.
end
TimeSpanSegment end time within the source audio.
confidence
floatConfidence 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 start
≤ end
.
No additional validation is performed here.