Class
RadSpeechToTextButton

A button that provides speech-to-text functionality using a speech recognizer.

Definition

Constructors

RadSpeechToTextButton()

Initializes a new instance of the RadSpeechToTextButton class.

Declaration

cs-api-definition
public RadSpeechToTextButton()

Fields

ErrorOccurredCommandProperty

Identifies the ErrorOccurredCommand bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty ErrorOccurredCommandProperty

Field Value

DependencyProperty

IsContinuousRecognitionProperty

Identifies the IsContinuousRecognition bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsContinuousRecognitionProperty

Field Value

DependencyProperty

LanguageTagProperty

Identifies the LanguageTag bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty LanguageTagProperty

Field Value

DependencyProperty

SpeechRecognizedCommandProperty

Identifies the SpeechRecognizedCommand bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty SpeechRecognizedCommandProperty

Field Value

DependencyProperty

SpeechRecognizerCreatorProperty

Identifies the SpeechRecognizerCreator bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty SpeechRecognizerCreatorProperty

Field Value

DependencyProperty

StateProperty

Identifies the State bindable property.

Declaration

cs-api-definition
public static readonly DependencyProperty StateProperty

Field Value

DependencyProperty

ToolTipStatesProperty

Identifies the ToolTipStates dependency property. Determines in which recognizer states the tooltip callout should be shown.

Declaration

cs-api-definition
public static readonly DependencyProperty ToolTipStatesProperty

Field Value

DependencyProperty

Properties

ErrorOccurredCommand

Gets or sets the command that is executed when an error occurs within the speech recognizer.

Declaration

cs-api-definition
public ICommand ErrorOccurredCommand { get; set; }

Property Value

ICommand

IsContinuousRecognition

Gets or sets a value indicating whether the speech recognizer operates in continuous recognition mode. When set to true, the recognizer will continuously listen and recognize speech until stopped. When set to false, recognizer will stop automatically after a single utterance or pause.

Declaration

cs-api-definition
public bool IsContinuousRecognition { get; set; }

Property Value

bool

LanguageTag

Gets or sets the IETF BCP 47 language tag for the speech recognizer. For example "en-US", "de-DE".

Declaration

cs-api-definition
public string LanguageTag { get; set; }

Property Value

string

SpeechRecognizedCommand

Gets or sets the command that is executed when speech is recognized.

Declaration

cs-api-definition
public ICommand SpeechRecognizedCommand { get; set; }

Property Value

ICommand

SpeechRecognizerCreator

Gets or sets the custom factory that creates a IRadSpeechRecognizer instance.

Declaration

cs-api-definition
public Func<IRadSpeechRecognizer> SpeechRecognizerCreator { get; set; }

Property Value

Func<IRadSpeechRecognizer>

State

Gets the current state of the speech recognizer.

Declaration

cs-api-definition
public SpeechRecognizerState State { get; }

Property Value

SpeechRecognizerState

ToolTipStates

Gets or sets the recognizer states in which the tooltip callout is enabled.

Declaration

cs-api-definition
public IList<SpeechRecognizerState> ToolTipStates { get; }

Property Value

IList<SpeechRecognizerState>

Methods

GetCalloutContent()

Gets the content object used in the callout tooltip based on the current speech recognizer state.

Declaration

cs-api-definition
protected virtual object GetCalloutContent()

Returns

object

A localized string describing the action for the current state, or null when no tooltip should be shown.

OnApplyTemplate()

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call. .

Declaration

cs-api-definition
public override void OnApplyTemplate()

Overrides RadButton.OnApplyTemplate()

OnClick()

Invoke the base OnClick and execute the associated Command.

Declaration

cs-api-definition
protected override void OnClick()

Overrides RadButton.OnClick()

OnCreateAutomationPeer()

Creates a RadButtonAutomationPeer.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

Overrides RadButton.OnCreateAutomationPeer()

OnInitialized(EventArgs)

Raises the event. This method is invoked whenever is set to true internally.

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

Overrides RadButton.OnInitialized(EventArgs)

OnMouseEnter(MouseEventArgs)

Starts the auto open timer.

Declaration

cs-api-definition
protected override void OnMouseEnter(MouseEventArgs e)

Parameters

e

MouseEventArgs

Overrides RadButton.OnMouseEnter(MouseEventArgs)

OnMouseLeave(MouseEventArgs)

Stops the auto open timer.

Declaration

cs-api-definition
protected override void OnMouseLeave(MouseEventArgs e)

Parameters

e

MouseEventArgs

Overrides RadButton.OnMouseLeave(MouseEventArgs)

StopListening()

Stops the speech to text button from listening.

If the speech recognizer is currently in the StartingListening or Listening state, this method will stop the recognition process. If the recognizer is not listening, this method has no effect.

Declaration

cs-api-definition
public Task StopListening()

Returns

Task

Events

CalloutOpening

Occurs before the callout tooltip is opened, allowing customization or cancellation.

Declaration

cs-api-definition
public event EventHandler<SpeechToTextTooltipOpeningEventArgs> CalloutOpening

Event Value

EventHandler<SpeechToTextTooltipOpeningEventArgs>

ErrorOccurred

Occurs when an error is encountered by the speech recognizer.

Declaration

cs-api-definition
public event EventHandler<SpeechRecognizerErrorOccurredEventArgs> ErrorOccurred

Event Value

EventHandler<SpeechRecognizerErrorOccurredEventArgs>

SpeechRecognized

Occurs when speech is successfully recognized.

Declaration

cs-api-definition
public event EventHandler<SpeechRecognizerSpeechRecognizedEventArgs> SpeechRecognized

Event Value

EventHandler<SpeechRecognizerSpeechRecognizedEventArgs>

StateChanged

Occurs when the state of the speech recognizer changes.

Declaration

cs-api-definition
public event EventHandler StateChanged

Event Value

EventHandler