New to Telerik UI for BlazorStart a free 30-day trial

A component that lets users start/stop speech recognition and receive transcribed text. Supports Web Speech or custom integration via SpeechToTextButtonIntegrationMode, events for lifecycle (OnStart, OnEnd, OnError), transcription results through OnResult, and configuration of Lang, Continuous, InterimResults, and MaxAlternatives. Provides programmatic control with StartAsync(), StopAsync(), and AbortAsync().

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
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.InvokeVoidAsyncWithoutAwait(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

C#
public TelerikSpeechToTextButton()

Methods

Aborts the speech recognition process.

C#
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.

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public override void Dispose()

Overrides: BaseComponent.Dispose()

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

Forces the component to re-render.

C#
public void Refresh()
C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: ComponentBase.SetParametersAsync(ParameterView)

Starts the speech-to-text recognition process.

C#
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.

Stops the speech recognition process.

C#
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.

Properties

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

C#
[Parameter]
public bool Continuous { get; set; }

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.

C#
[Parameter]
public SpeechToTextButtonIntegrationMode IntegrationMode { get; set; }

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

C#
[Parameter]
public bool InterimResults { get; set; }

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

C#
public bool IsListening { get; }

Gets a value indicating whether web speech functionality is supported.

C#
public bool IsWebSpeechSupported { get; }

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

C#
[Parameter]
public string Lang { get; set; }

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

C#
[Parameter]
public int MaxAlternatives { get; set; }

The Click handler of the button.

C#
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Event that fires when the speech recognition service has disconnected.

C#
[Parameter]
public EventCallback OnEnd { get; set; }

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

C#
[Parameter]
public EventCallback<string> OnError { get; set; }

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

C#
[Parameter]
public EventCallback<SpeechToTextButtonResultEventArgs> OnResult { get; set; }

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

C#
[Parameter]
public EventCallback OnStart { get; set; }