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
textstringThe recognized transcript for this segment.
languagestringThe BCP-47 language code of the transcript (e.g., "en", "fr").
startTimeSpanSegment start time within the source audio.
endTimeSpanSegment end time within the source audio.
confidencefloatConfidence 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.