Skip to content

Commit 54d6ec3

Browse files
authored
Merge pull request #4600 from syncfusion-content/986985-stt-content
986985: updated the speech samples description
2 parents 8ea27cf + 956a9e4 commit 54d6ec3

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

ej2-asp-core-mvc/ai-assistview/EJ2_ASP.MVC/speech/speech-to-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation: ug
1010

1111
# Speech-to-Text in ASP.NET MVC AI AssistView
1212

13-
The Syncfusion ASP.NET MVC AI AssistView control supports `Speech-to-Text` functionality through the browser's [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API), enabling conversion of spoken words into text using the device's microphone.
13+
The Syncfusion ASP.NET MVC AI AssistView control integrates `Speech-to-Text` functionality through the browser's [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API). This enables the conversion of spoken words into text using the device's microphone, allowing users to interact with the AI AssistView through voice input.
1414

1515
## Prerequisites
1616

ej2-asp-core-mvc/ai-assistview/EJ2_ASP.MVC/speech/text-to-speech.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation: ug
1010

1111
# Text-to-Speech in ASP.NET MVC AI AssistView
1212

13-
The Syncfusion TypeScript AI AssistView component supports `Text-to-Speech` (TTS) functionality using the browser's Web Speech API specifically using the [SpeechSynthesisUtterance](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance) interface to convert AI-generated response into spoken audio.
13+
The Syncfusion TypeScript AI AssistView control integrates `Text-to-Speech` (TTS) functionality using the browser's Web Speech API, specifically the [SpeechSynthesisUtterance](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance) interface. This allows AI-generated responses to be converted into spoken audio, enhancing accessibility and user interaction.
1414

1515
## Prerequisites
1616

ej2-asp-core-mvc/ai-assistview/EJ2_ASP.NETCORE/speech/speech-to-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation: ug
1010

1111
# Speech-to-Text in ASP.NET Core AI AssistView
1212

13-
The Syncfusion ASP.NET Core AI AssistView control supports `Speech-to-Text` functionality through the browser's [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API), enabling conversion of spoken words into text using the device's microphone.
13+
The Syncfusion ASP.NET Core AI AssistView control integrates `Speech-to-Text` functionality through the browser's [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API). This enables the conversion of spoken words into text using the device's microphone, allowing users to interact with the AI AssistView through voice input.
1414

1515
## Prerequisites
1616

ej2-asp-core-mvc/ai-assistview/EJ2_ASP.NETCORE/speech/text-to-speech.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation: ug
1010

1111
# Text-to-Speech in ASP.NET Core AI AssistView
1212

13-
The Syncfusion TypeScript AI AssistView component supports `Text-to-Speech` (TTS) functionality using the browser's Web Speech API specifically using the [SpeechSynthesisUtterance](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance) interface to convert AI-generated response into spoken audio.
13+
The Syncfusion TypeScript AI AssistView control integrates `Text-to-Speech` (TTS) functionality using the browser's Web Speech API, specifically the [SpeechSynthesisUtterance](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance) interface. This allows AI-generated responses to be converted into spoken audio, enhancing accessibility and user interaction.
1414

1515
## Prerequisites
1616

ej2-asp-core-mvc/code-snippet/ai-assistview/speech/tts/razor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@
2929
var stopStreaming = false;
3030
var currentUtterance;
3131

32+
// Initializes the AIAssistView component reference when created
3233
function onCreated() {
3334
assistObj = ej.base.getComponent(document.getElementById("aiAssistView"), "aiassistview");
3435
}
3536

37+
// Handles toolbar item clicks, such as clearing the conversation on refresh
3638
function toolbarItemClicked(args) {
3739
if (args.item.iconCss === 'e-icons e-refresh') {
3840
assistObj.prompts = [];
3941
stopStreaming = true;
4042
}
4143
}
4244

45+
// Handles clicks on response toolbar items, such as copying, reading aloud, liking, or disliking the response
4346
function onResponseToolbarItemClicked(args) {
4447
const responseHtml = assistObj.prompts[args.dataIndex].response;
4548
if (responseHtml) {
@@ -68,6 +71,7 @@
6871
}
6972
}
7073

74+
// Streams the AI response character by character to create a typing effect
7175
async function streamResponse(response) {
7276
let lastResponse = '';
7377
const responseUpdateRate = 10;
@@ -85,6 +89,7 @@
8589
}
8690
}
8791

92+
// Handles prompt requests by sending them to the server API endpoint and streaming the response
8893
function onPromptRequest(args) {
8994
// Get antiforgery token
9095
var tokenElement = document.querySelector('input[name="__RequestVerificationToken"]');
@@ -121,6 +126,7 @@
121126
});
122127
}
123128

129+
// Stops the ongoing streaming response
124130
function stopRespondingClick() {
125131
stopStreaming = true;
126132
}

ej2-asp-core-mvc/code-snippet/ai-assistview/speech/tts/tagHelper

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@
2424
var stopStreaming = false;
2525
var currentUtterance;
2626

27+
// Initializes the AIAssistView component reference when created
2728
function onCreated() {
2829
assistObj = ej.base.getComponent(document.getElementById("aiAssistView"), "aiassistview");
2930
}
3031

32+
// Handles toolbar item clicks, such as clearing the conversation on refresh
3133
function toolbarItemClicked(args) {
3234
if (args.item.iconCss === 'e-icons e-refresh') {
3335
assistObj.prompts = [];
3436
stopStreaming = true;
3537
}
3638
}
3739

40+
// Handles clicks on response toolbar items, such as copying, reading aloud, liking, or disliking the response
3841
function onResponseToolbarItemClicked(args) {
3942
const responseHtml = assistObj.prompts[args.dataIndex].response;
4043
if (responseHtml) {
@@ -63,7 +66,7 @@
6366
}
6467
}
6568

66-
69+
// Streams the AI response character by character to create a typing effect
6770
async function streamResponse(response) {
6871
let lastResponse = '';
6972
const responseUpdateRate = 10;
@@ -81,6 +84,7 @@
8184
}
8285
}
8386

87+
// Handles prompt requests by sending them to the server API endpoint and streaming the response
8488
function onPromptRequest(args) {
8589
// Get antiforgery token
8690
var tokenElement = document.querySelector('input[name="__RequestVerificationToken"]');
@@ -117,6 +121,7 @@
117121
});
118122
}
119123

124+
// Stops the ongoing streaming response
120125
function stopRespondingClick() {
121126
stopStreaming = true;
122127
}

0 commit comments

Comments
 (0)