Table of Contents

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 SpeechSegment

Inheritance

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

text string

The recognized text.

startTime TimeSpan

The segment start time on the media timeline.

endTime TimeSpan

The segment end time on the media timeline.

isFinal bool

Reserved to mark a segment final (true) versus an interim hypothesis (false). Segments are currently always final.

language string

The detected/used language (ISO code), or null if unknown.

confidence float

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

float

EndTime

Gets or sets the segment end time, relative to the start of the stream.

public TimeSpan EndTime { get; set; }

Property Value

TimeSpan

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

bool

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

string

StartTime

Gets or sets the segment start time, relative to the start of the stream.

public TimeSpan StartTime { get; set; }

Property Value

TimeSpan

Text

Gets or sets the recognized text for this segment.

public string Text { get; set; }

Property Value

string