Class
TelerikSpeechToTextButton

The class for the Telerik SpeechToTextButton component.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class TelerikSpeechToTextButton : ButtonBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentButtonBaseTelerikSpeechToTextButton

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members ButtonBase.IdButtonBase.ChildContentButtonBase.TitleButtonBase.IconButtonBase.EnabledButtonBase.TabIndexButtonBase.FillModeButtonBase.RoundedButtonBase.SizeButtonBase.ThemeColorButtonBase.AriaLabelButtonBase.AriaLabelledByButtonBase.AriaDescribedByButtonBase.AriaControlsBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)

Constructors

TelerikSpeechToTextButton()

Declaration

cs-api-definition
public TelerikSpeechToTextButton()

Properties

Continuous

Whether continuous results are returned for each recognition, or only a single result. Defaults value is false.

Declaration

cs-api-definition
[Parameter]
public bool Continuous { get; set; }

Property Value

bool

IntegrationMode

The speech recognition engine or integration the component should use. This allows the component to operate in different environments or use alternative implementations. If unset, WebSpeech will be used.

Declaration

cs-api-definition
[Parameter]
public SpeechToTextButtonIntegrationMode IntegrationMode { get; set; }

Property Value

SpeechToTextButtonIntegrationMode

InterimResults

Whether interim results should be returned. Interim results are results that are not yet final. Defaults value is false.

Declaration

cs-api-definition
[Parameter]
public bool InterimResults { get; set; }

Property Value

bool

IsListening

Gets a value indicating whether the button is actively listening for incoming audio.

Declaration

cs-api-definition
public bool IsListening { get; }

Property Value

bool

IsWebSpeechSupported

Gets a value indicating whether web speech functionality is supported.

Declaration

cs-api-definition
public bool IsWebSpeechSupported { get; }

Property Value

bool

Lang

BCP 47 language tag (e.g., 'en-US', 'bg-BG'). Defaults to browser/system language.

Declaration

cs-api-definition
[Parameter]
public string Lang { get; set; }

Property Value

string

MaxAlternatives

The maximum returned alternatives for each result. Defaults value is 1.

Declaration

cs-api-definition
[Parameter]
public int MaxAlternatives { get; set; }

Property Value

int

OnClick

The Click handler of the button.

Declaration

cs-api-definition
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

OnEnd

Event that fires when the speech recognition service has disconnected.

Declaration

cs-api-definition
[Parameter]
public EventCallback OnEnd { get; set; }

Property Value

EventCallback

OnError

Event that fires when a speech recognition error occurs, providing error details.

Declaration

cs-api-definition
[Parameter]
public EventCallback<string> OnError { get; set; }

Property Value

EventCallback<string>

OnResult

Event that fires when the speech recognition service returns a result - a word or phrase has been positively recognized.

Declaration

cs-api-definition
[Parameter]
public EventCallback<SpeechToTextButtonResultEventArgs> OnResult { get; set; }

Property Value

EventCallback<SpeechToTextButtonResultEventArgs>

OnStart

Event that fires when the speech recognition service has begun listening to incoming audio.

Declaration

cs-api-definition
[Parameter]
public EventCallback OnStart { get; set; }

Property Value

EventCallback

Methods

AbortAsync()

Aborts the speech recognition process.

Declaration

cs-api-definition
public Task AbortAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

If the IntegrationMode is set to None, the method invokes the OnEnd event. Otherwise, it ends the speech recognition using the specified mode without returning a result.

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

Refresh()

Forces the component to re-render.

Declaration

cs-api-definition
public void Refresh()

SetParametersAsync(ParameterView)

Declaration

cs-api-definition
public override Task SetParametersAsync(ParameterView parameters)

Parameters

parameters

ParameterView

Returns

Task

Overrides ComponentBase.SetParametersAsync(ParameterView)

StartAsync()

Starts the speech-to-text recognition process.

Declaration

cs-api-definition
public Task StartAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

If the IntegrationMode is set to None, the method invokes the OnStart event. Otherwise, it start speech recognition using the specified mode.

StopAsync()

Stops the speech recognition process.

Declaration

cs-api-definition
public Task StopAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

If the IntegrationMode is set to None, the method invokes the OnEnd event. Otherwise, it ends the speech recognition using the specified mode.