ClassTelerikSpeechToTextButton
The class for the Telerik SpeechToTextButton component.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class TelerikSpeechToTextButton : ButtonBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentButtonBaseTelerikSpeechToTextButton
Implements:
Inherited Members
Constructors
TelerikSpeechToTextButton()
Declaration
public TelerikSpeechToTextButton()
Properties
Continuous
Whether continuous results are returned for each recognition, or only a single result. Defaults value is false.
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
[Parameter]
public SpeechToTextButtonIntegrationMode IntegrationMode { get; set; }
Property Value
InterimResults
Whether interim results should be returned. Interim results are results that are not yet final. Defaults value is false.
Declaration
[Parameter]
public bool InterimResults { get; set; }
Property Value
IsListening
Gets a value indicating whether the button is actively listening for incoming audio.
IsWebSpeechSupported
Gets a value indicating whether web speech functionality is supported.
Lang
BCP 47 language tag (e.g., 'en-US', 'bg-BG'). Defaults to browser/system language.
MaxAlternatives
The maximum returned alternatives for each result. Defaults value is 1.
Declaration
[Parameter]
public int MaxAlternatives { get; set; }
Property Value
OnClick
The Click handler of the button.
Declaration
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
OnEnd
Event that fires when the speech recognition service has disconnected.
Declaration
[Parameter]
public EventCallback OnEnd { get; set; }
Property Value
OnError
Event that fires when a speech recognition error occurs, providing error details.
Declaration
[Parameter]
public EventCallback<string> OnError { get; set; }
Property Value
OnResult
Event that fires when the speech recognition service returns a result - a word or phrase has been positively recognized.
Declaration
[Parameter]
public EventCallback<SpeechToTextButtonResultEventArgs> OnResult { get; set; }
Property Value
OnStart
Event that fires when the speech recognition service has begun listening to incoming audio.
Declaration
[Parameter]
public EventCallback OnStart { get; set; }
Property Value
Methods
AbortAsync()
Aborts the speech recognition process.
Declaration
public Task AbortAsync()
Returns
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
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
Dispose()
Declaration
public override void Dispose()
Overrides
SetParametersAsync(ParameterView)
Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
parameters
Returns
Overrides
StartAsync()
Starts the speech-to-text recognition process.
Declaration
public Task StartAsync()
Returns
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
public Task StopAsync()
Returns
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.