SpeechCue SpeechCue SpeechCue SpeechCue Class

Definition

Represents a speech cue that can be included in a TimedMetadataTrack. This cue can be used to receive events based on metadata included in a text-to-speech (TTS) stream, such as word boundaries, sentence boundaries, and Speech Sythesis Markup Language (SSML) bookmarks.

public : sealed class SpeechCue : IMediaCue, ISpeechCue
public sealed class SpeechCue : IMediaCue, ISpeechCue
Public NotInheritable Class SpeechCue Implements IMediaCue, ISpeechCue
var speechCue = new speechCue();
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

A SpeechCue can be added to a TimedMetadataTrack with the AddCue method. When the cue's start time is reached, the CueEntered event is raised and you can use the MediaCueEventArgs passed into the handler to get a copy of the SpeechCue.

The SpeechSynthesizer class generates metadata that uses the following values for the TimedMetataTrack.Label in order to identify the type of speech metadata included in a track.

LabelDescription
SpeechBookmarkThe metadata track contains SSML bookmarks.
SpeechSentenceThe metadata track contains sentence boundaries.
SpeechWordThe metadata track contains word boundaries.

Constructors

SpeechCue() SpeechCue() SpeechCue() SpeechCue()

Initializes a new instance of the SpeechCue class.

public : SpeechCue()
public SpeechCue()
Public Sub New()
var speechCue = new speechCue();

Properties

Duration Duration Duration Duration

Gets or sets the duration of the cue.

public : TimeSpan Duration { get; set; }
public TimeSpan Duration { get; set; }
Public ReadWrite Property Duration As TimeSpan
var timeSpan = speechCue.duration;
speechCue.duration = timeSpan;
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The duration of the cue.

Remarks

At the end of a cue's duration, the TimedMetadataTrack.CueExited event is raised.

EndPositionInInput EndPositionInInput EndPositionInInput EndPositionInInput

Gets or sets the offset into the string contained in the Text property of the last character in the word or sentence associated with the cue.

public : IReference<int> EndPositionInInput { get; set; }
public Nullable<int> EndPositionInInput { get; set; }
Public ReadWrite Property EndPositionInInput As Nullable<int>
var nullable = speechCue.endPositionInInput;
speechCue.endPositionInInput = nullable;
Value
IReference<int> Nullable<int> Nullable<int> Nullable<int>

The offset into the string contained in the Text property of the last character in the word or sentence associated with the cue.

Remarks

This value is exclusive of any surrounding or inline formatting of the string.

This value is null for SSML bookmarks.

Id Id Id Id

Gets the identifier for the timed metadata track

public : Platform::String Id { get; set; }
public string Id { get; set; }
Public ReadWrite Property Id As string
var string = speechCue.id;
speechCue.id = string;
Value
Platform::String string string string

The identifier for the timed metadata track

StartPositionInInput StartPositionInInput StartPositionInInput StartPositionInInput

Gets or sets the offset into the string contained in the Text property of the first character in the word or sentence associated with the cue.

public : IReference<int> StartPositionInInput { get; set; }
public Nullable<int> StartPositionInInput { get; set; }
Public ReadWrite Property StartPositionInInput As Nullable<int>
var nullable = speechCue.startPositionInInput;
speechCue.startPositionInInput = nullable;
Value
IReference<int> Nullable<int> Nullable<int> Nullable<int>

The offset into the string contained in the Text property of the first character in the word or sentence associated with the cue.

Remarks

This value is exclusive of any surrounding or inline formatting of the string.

This value is null for SSML bookmarks.

StartTime StartTime StartTime StartTime

Gets the start time of the cue.

public : TimeSpan StartTime { get; set; }
public TimeSpan StartTime { get; set; }
Public ReadWrite Property StartTime As TimeSpan
var timeSpan = speechCue.startTime;
speechCue.startTime = timeSpan;
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The start time of the cue.

Remarks

When a cue's start time is reached, the TimedMetadataTrack.CueEntered event is raised.

Text Text Text Text

Gets or sets the text associated with the speech cue.

public : Platform::String Text { get; set; }
public string Text { get; set; }
Public ReadWrite Property Text As string
var string = speechCue.text;
speechCue.text = string;
Value
Platform::String string string string

The text associated with the speech cue.