Class SpeechSegment
- Namespace
- VisioForge.Core.Types.X.AI
- Assembly
- VisioForge.Core.dll
A single recognized speech segment: a span of transcribed text with its start/end time on the media timeline.
public class SpeechSegmentInheritance
Inherited Members
Remarks
Raised inside VisioForge.Core.Types.Events.SpeechRecognizedEventArgs. The times are relative to the start of the stream and are suitable for direct use when writing SRT/VTT subtitles or scheduling an on-screen overlay.
Constructors
SpeechSegment()
Initializes a new instance of the VisioForge.Core.Types.X.AI.SpeechSegment class.
public SpeechSegment()SpeechSegment(string, TimeSpan, TimeSpan, bool, string, float)
Initializes a new instance of the VisioForge.Core.Types.X.AI.SpeechSegment class.
public SpeechSegment(string text, TimeSpan startTime, TimeSpan endTime, bool isFinal, string language, float confidence)Parameters
textstring-
The recognized text.
startTimeTimeSpan-
The segment start time on the media timeline.
endTimeTimeSpan-
The segment end time on the media timeline.
isFinalbool-
Reserved to mark a segment final (
true) versus an interim hypothesis (false). Segments are currently always final. languagestring-
The detected/used language (ISO code), or
nullif unknown. confidencefloat-
The average token confidence (0..1), or 0 when not provided by the model.
Properties
Confidence
Gets or sets the average token confidence for this segment in the range 0..1, or 0 when the model does not report token probabilities.
public float Confidence { get; set; }Property Value
EndTime
Gets or sets the segment end time, relative to the start of the stream.
public TimeSpan EndTime { get; set; }Property Value
IsFinal
Gets or sets a value indicating whether this segment is final. Segments are currently always final
(true); this flag is reserved to distinguish interim (non-final) hypotheses once that capability
exists, at which point an interim segment could be superseded by a later final one covering the same span.
public bool IsFinal { get; set; }Property Value
Language
Gets or sets the language of the segment as an ISO 639-1 code (for example, "en"), or null when unknown.
public string Language { get; set; }Property Value
StartTime
Gets or sets the segment start time, relative to the start of the stream.
public TimeSpan StartTime { get; set; }Property Value
Text
Gets or sets the recognized text for this segment.
public string Text { get; set; }