Share via


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 ref class SpeechCue sealed
/// [Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SpeechCue final
[Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SpeechCue
function SpeechCue()
Public NotInheritable Class SpeechCue
Inheritance
Object Platform::Object IInspectable SpeechCue
Attributes
Implements

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

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()

Initializes a new instance of the SpeechCue class.

Properties

Duration

Gets or sets the duration of the cue.

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.

Id

Gets the identifier for the timed metadata track

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.

StartTime

Gets the start time of the cue.

Text

Gets or sets the text associated with the speech cue.

Applies to