Skip to content

Commit eb17588

Browse files
Merge pull request #6695 from syncfusion-content/983717-UG-docs-STT-3
983717: Enhanced the blazor documentation for Speech-to-text
2 parents 7dc641a + 946cadd commit eb17588

File tree

3 files changed

+48
-52
lines changed

3 files changed

+48
-52
lines changed

blazor/speech-to-text/methods.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ documentation: ug
99

1010
# Methods in Blazor SpeechToText component
1111

12+
The Blazor SpeechToText component provides public methods that allow you to programmatically control its listening state.
13+
1214
## Start listening
1315

14-
You can use the [StartListeningAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_StartListeningAsync) public method to initiate the speech recognition and begins the conversion of the speech to text.
16+
The [StartListeningAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_StartListeningAsync) public method programmatically initiates speech recognition. When called, the component begins capturing audio and converting it to text.
1517

1618
## Stop listening
1719

18-
You can use the [StopListeningAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_StopListeningAsync) public method to stop capturing your speech and ends the speech recognition.
20+
The [StopListeningAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_StopListeningAsync) public method programmatically stops the speech recognition process.
1921

20-
Below sample demonstrates the SpeechToText component configured with above methods.
22+
The following example demonstrates the SpeechToText component configured with above methods.
2123

2224
{% tabs %}
2325
{% highlight razor %}

blazor/speech-to-text/security.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ control: SpeechToText
77
documentation: ug
88
---
99

10-
# Security concerns in Blazor SpeechToText component
10+
# Security concerns in Blazor SpeechToText Component
1111

1212
## Online dependency
1313

14-
The SpeechToText component typically relies on browser-based APIs, which may require an active internet connection. If an internet connection is unavailable, an offline fallback should be considered.
14+
The Syncfusion Blazor SpeechToText component utilizes browser-based Web Speech APIs, which generally require an active internet connection to process speech data. This dependency introduces important security and privacy considerations that developers must address.
1515

16-
## Potential security risks
16+
## Potential Security Risks
1717

18-
Understanding the risks associated with speech recognition.
18+
When using speech recognition technology, it is essential to be aware of the following potential security risks:
1919

20-
### Data transmission to external servers
20+
### Data Transmission to External Servers
2121

22-
The audio data is sent to third-party servers (e.g., Google, Microsoft) for processing. So the sensitive spoken information might be exposed to external entities.
22+
Since speech-to-text processing is often handled by third-party services (e.g., Google, Microsoft), audio data is transmitted to external servers. This can expose sensitive spoken information to external entities.
2323

24-
### Privacy concerns
24+
### Privacy Concerns
2525

26-
Some services may store user voice data for analytics or improving AI models. Users should verify browser and service policies.
26+
Some speech recognition services may retain voice data for analytics or to improve their models. It is crucial to review the privacy policies of both the browser and the specific speech service being used.
2727

28-
### Man-in-the-Middle (MITM) attacks
28+
### Man-in-the-Middle (MITM) Attacks
2929

30-
Without HTTPS, attackers could intercept audio data during transmission.
30+
If the application is not served over HTTPS, attackers could intercept the audio data stream during transmission in a Man-in-the-Middle (MITM) attack.
3131

32-
### Browser and permission exploits
32+
### Browser and Permission Exploits
3333

34-
Malicious websites may misuse permissions to eavesdrop on conversations. Explicit user consent is essential before enabling microphone access.
34+
A malicious website could misuse microphone permissions to eavesdrop on user conversations. Therefore, obtaining explicit user consent before accessing the microphone is a critical security measure.
3535

36-
## Mitigation strategies
36+
## Mitigation Strategies
3737

38-
Ensuring security and privacy when using speech recognition and how to mitigate them.
38+
To ensure security and privacy when implementing speech recognition, adopt the following mitigation strategies:
3939

4040
* Use the component only in trusted environments.
4141
* Inform users about third-party data processing.

blazor/speech-to-text/speech-recognition.md

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ documentation: ug
99

1010
# Speech recognition in Blazor SpeechToText component
1111

12+
The Syncfusion Blazor SpeechToText component offers a comprehensive set of features for managing the speech recognition process. You can retrieve transcribed text, configure the recognition language, control interim results, monitor the component's state, and handle errors.
13+
1214
## Retrieving transcripts
1315

14-
You can use the [Transcript](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Transcript) property to retrieve the transcribed text from the spoken text. This property allows to display the transcribed text once the speech recognition process is started.
16+
Use the [Transcript](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Transcript) property to retrieve the transcribed text from spoken input. This property allows to display the transcribed text once the speech recognition process is started.
1517

1618
{% tabs %}
1719
{% highlight razor %}
@@ -42,7 +44,7 @@ You can use the [Transcript](https://help.syncfusion.com/cr/blazor/Syncfusion.Bl
4244

4345
## Setting language
4446

45-
You can use the [Language](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Language) property to specify the language for speech recognition. Setting this property ensures that the recognition engine interprets the spoken words correctly based on the specified locale such as `en-US` for American `English`, `fr-FR` for `French`, and more.
47+
Specify the recognition language using the [Language](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Language) property. This ensures the recognition engine correctly interprets speech based on the specified locale. The property accepts standard language codes, such as `en-US` for American English, `fr-FR` for French, or `es-ES` for Spanish.
4648

4749
{% tabs %}
4850
{% highlight razor %}
@@ -73,7 +75,7 @@ You can use the [Language](https://help.syncfusion.com/cr/blazor/Syncfusion.Blaz
7375

7476
## Allowing interim results
7577

76-
You can use the [AllowInterimResults](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_AllowInterimResults) property to enable or disable interim results. When set to `true`, the recognized speech will be displayed in real time as words are spoken. When set to `false`, only final results will be displayed after recognition is complete. By default, the value is `true`.
78+
The [AllowInterimResults](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_AllowInterimResults) property controls whether the component displays transcription results as they are being recognized. When `true` (the default), the `Transcript` is updated continuously. When `false`, the `Transcript` is updated only after the speaker pauses and the engine finalizes the result.
7779

7880
{% tabs %}
7981
{% highlight razor %}
@@ -104,19 +106,11 @@ You can use the [AllowInterimResults](https://help.syncfusion.com/cr/blazor/Sync
104106

105107
## Managing listening state
106108

107-
You can use the [ListeningState](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_ListeningState) property to manage the listening state of the component. The possible values are `Inactive`, `Listening` and `Stopped`. By default, the value is `Inactive`.
108-
109-
### Inactive
110-
111-
The component is in idle state with no active speech recognition.
112-
113-
### Listening
114-
115-
It is actively listening which captures and transcribes speech with a stop icon and blinking animation.
116-
117-
### Stopped
109+
Track the component's status using the [ListeningState](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_ListeningState) property, which returns the current state of the speech recognition process. This is useful for providing visual feedback to the user.
118110

119-
Denotes the speech recognition has ended, and no further speech is being processed.
111+
* **Inactive**: The component is idle and not performing any recognition. This is the default state.
112+
* **Listening**: The component is actively capturing audio and transcribing speech.
113+
* **Stopped**: The speech recognition process has ended, and the component is no longer capturing audio.
120114

121115
Below sample demonstrates the usage of [ListeningState](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_ListeningState) property.
122116

@@ -251,7 +245,7 @@ Below sample demonstrates the usage of [ListeningState](https://help.syncfusion.
251245

252246
## Show or hide tooltip
253247

254-
You can use the [ShowTooltip](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_ShowTooltip) property to specify the tooltip text to be displayed on hovering the SpeechToText button. By default, the value is `true`.
248+
Control the visibility of the tooltip on the component's microphone button using the [ShowTooltip](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_ShowTooltip) boolean property. When set to `false`, the default tooltip will not be displayed on hover. The default value is `true`.
255249

256250
{% tabs %}
257251
{% highlight razor %}
@@ -284,7 +278,7 @@ You can use the [ShowTooltip](https://help.syncfusion.com/cr/blazor/Syncfusion.B
284278

285279
## Setting disabled
286280

287-
You can use the [Disabled](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Disabled) property to disable the SpeechToText component, preventing user interaction when set to `true`. By default, the value is `false`.
281+
Disable the SpeechToText component by setting the [Disabled](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_Disabled) property to `true`. This prevents all user interaction with the microphone button. By default, this property is `false`.
288282

289283
{% tabs %}
290284
{% highlight razor %}
@@ -317,31 +311,31 @@ You can use the [Disabled](https://help.syncfusion.com/cr/blazor/Syncfusion.Blaz
317311

318312
## Setting html attributes
319313

320-
You can use the [HtmlAttributes](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_HtmlAttributes) property to assign custom attributes to the SpeechToText component for the button element.
314+
The [HtmlAttributes](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfSpeechToText.html#Syncfusion_Blazor_Inputs_SfSpeechToText_HtmlAttributes) property allows you to add custom HTML attributes to the component's root element.
321315

322316
## Error handling
323317

324-
The SpeechToText component handles various errors that may occur during speech recognition. The following table lists the possible errors and their causes:
318+
The SpeechToText component provides error events to handle various issues during speech recognition. The following table lists common errors and their causes:
325319

326320
| Error | Cause |
327321
|----------------------|----------------------------------------------------------------------------------------------|
328-
| `no-speech` | The microphone did not detect any speech input. |
329-
| `aborted` | The speech recognition process was intentionally terminated. |
330-
| `audio-capture` | The system was unable to detect a microphone device. |
331-
| `not-allowed` | Access to the microphone was denied by the user or browser settings. |
332-
| `service-not-allowed` | The current context does not permit the use of the speech recognition service. |
333-
| `network` | A network issue is preventing the speech recognition service from functioning. |
334-
| `unsupported-browser` | The browser being used does not support the SpeechRecognition API. |
335-
| `default` | An unidentified error occurred during the speech recognition process. |
322+
| `no-speech` | The microphone did not detect any speech. |
323+
| `aborted` | The recognition process was terminated, either by the user or programmatically. |
324+
| `audio-capture` | No microphone was found, or there was an issue accessing it. |
325+
| `not-allowed` | Microphone access was denied by the user or a browser security policy. |
326+
| `service-not-allowed` | The browser or service denied recognition for security reasons. |
327+
| `network` | A network connection error prevented communication with the recognition service. |
328+
| `unsupported-browser` | The browser does not support the Web Speech API. |
329+
| `default` | An unspecified or unknown error occurred. |
336330

337331
## Browser support
338332

339-
The SpeechToText component relies on the [Speech Recognition API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition) for processing the speech input. Ensure that the browser supports this API before implementation.
333+
The SpeechToText component relies on the browser's implementation of the [Speech Recognition API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition). Ensure target browsers support this API.
340334

341-
| Browser | Supported versions |
342-
|--------------|---------------|
343-
| Chrome | 25+ |
344-
| Edge | 79+ |
345-
| Firefox | Not Supported |
346-
| Safari | 12+ |
347-
| Opera | 30+ |
335+
| Browser | Supported Versions |
336+
|--------------|--------------------|
337+
| Chrome | 25+ |
338+
| Edge | 79+ |
339+
| Safari | 12+ |
340+
| Opera | 30+ |
341+
| Firefox | Not Supported |

0 commit comments

Comments
 (0)