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, ISpeechCuepublic sealed class SpeechCue : IMediaCue, ISpeechCuePublic NotInheritable Class SpeechCue Implements IMediaCue, ISpeechCue
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 word boundaries
SpeechWordThe metadata track contains sentence boundaries

Constructors

SpeechCue() SpeechCue() SpeechCue()

Initializes a new instance of the SpeechCue class.

public SpeechCue()public SpeechCue()Public Sub New()
Attributes

Properties

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
Value
TimeSpan TimeSpan TimeSpan

The duration of the cue.

Attributes

Remarks

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

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 IReference<int> EndPositionInInput { get; set; }Public ReadWrite Property EndPositionInInput As IReference<int>
Value

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

Attributes

Remarks

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

This value is null for SSML bookmarks.

Id Id Id

Gets the identifier for the timed metadata track

public string Id { get; set; }public string Id { get; set; }Public ReadWrite Property Id As string
Value
string string string

The identifier for the timed metadata track

Attributes

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 IReference<int> StartPositionInInput { get; set; }Public ReadWrite Property StartPositionInInput As IReference<int>
Value

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

Attributes

Remarks

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

This value is null for SSML bookmarks.

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
Value
TimeSpan TimeSpan TimeSpan

The start time of the cue.

Attributes

Remarks

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

Text Text Text

Gets or sets the text associated with the speech cue.

public string Text { get; set; }public string Text { get; set; }Public ReadWrite Property Text As string
Value
string string string

The text associated with the speech cue.

Attributes