Class SpeechToText
Inheritance
Namespace: Syncfusion.EJ2.Inputs
Assembly: Syncfusion.EJ2.dll
Syntax
public class SpeechToText : EJTagHelper
Constructors
SpeechToText()
Declaration
public SpeechToText()
Properties
AllowInterimResults
Determines whether interim results should be provided during speech recognition. If true, partial results are delivered in real-time, allowing for a dynamic user experience. If false, only final results will be provided after the recognition process is complete.
Declaration
public bool AllowInterimResults { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
ButtonSettings
Customizes the appearance and functionality of the record button. This allows for customization of button content, icons, and positions. Use it to adjust the button's visual and functional properties according to your needs.
Declaration
public SpeechToTextButtonSettings ButtonSettings { get; set; }
Property Value
Type | Description |
---|---|
SpeechToTextButtonSettings | The default value is null |
ContentTemplate
To get or set value for ContentTemplate.
Declaration
public MvcTemplate<object> ContentTemplate { get; set; }
Property Value
Type |
---|
Syncfusion.EJ2.MvcTemplate<System.Object> |
Created
Triggered when the SpeechToText component is initialized and ready for interaction. This event indicates that the component is fully loaded and can start processing user input. Use this event to execute initialization logic or show the component's ready state.
Declaration
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CssClass
Specifies additional CSS classes for customizing the component's appearance. Allows applying custom styles to match application requirements This property can be used to extend the component's default style.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
Disabled
Indicates whether the component is disabled. When true, all interactions with the component (e.g., clicking, listening) are disabled. Useful for preventing user interaction in specific states, such as during processing or error handling.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnablePersistence
Enable or disable persisting component's state between page reloads.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
HtmlAttributes
Allows additional HTML attributes to be added to the root element of the SpeechToText button. This property accepts a key-value pair format for attributes such as name, aria-label, and others. This helps to make the button more accessible and adaptable to specific requirements.
Declaration
public object HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
Lang
The language and locale used for speech recognition. This ensures proper transcription by selecting the correct language model. Common formats: 'en-US' (English, United States), 'es-ES' (Spanish, Spain), 'fr-FR' (French, France).
Declaration
public string Lang { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
ListeningState
Represents the current operational state of the component. This state helps manage transitions and control the component's behavior. Possible values:
- 'Inactive': Component is idle.
- 'Listening': The component is actively listening for speech input.
- 'Stopped': Listening has stopped.
Declaration
public SpeechToTextState ListeningState { get; set; }
Property Value
Type | Description |
---|---|
SpeechToTextState | The default value is SpeechToTextState.Inactive |
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
OnError
Triggered when an error occurs during speech recognition or listening, this event provides details to handle exceptions, display messages, and troubleshoot issues like microphone failures, network errors, or unsupported browsers and language models.
Declaration
public string OnError { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
OnStart
Triggered when speech recognition begins listening for audio input. This event fires when the user starts the speech-to-text process. Use this event to execute logic or display feedback (e.g., a "Listening..." message).
Declaration
public string OnStart { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
OnStop
Triggered when speech recognition stops listening for audio input. This event marks the end of the listening session, either due to user action or completion of recognition. Use this event to trigger post-processing logic or indicate that listening has ended (e.g., show "Listening stopped").
Declaration
public string OnStop { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
ShowTooltip
Determines whether the tooltip should be displayed on hover over the SpeechToText button. If true, the tooltip will be shown to provide additional information about the current state or action.
Declaration
public bool ShowTooltip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
TooltipSettings
Defines tooltip content and positioning for guiding user interactions. Tooltips provide helpful instructions or descriptions for button actions, improving user experience.
Declaration
public SpeechToTextTooltipSettings TooltipSettings { get; set; }
Property Value
Type | Description |
---|---|
SpeechToTextTooltipSettings | The default value is null |
Transcript
The transcribed text from the speech-to-text process. This property updates dynamically during speech recognition, providing both interim and final results. It can be used to display or process the transcribed speech.
Declaration
public string Transcript { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
TranscriptChanged
Triggered when the transcript is updated during the speech recognition process. This event delivers updated text as the user speaks. It can be used to update the UI with real-time transcription. The event provides both interim and final transcript results, depending on the configuration.
Declaration
public string TranscriptChanged { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |