All Demos / AI AssistView / Speech / Text To Speech

Blazor AI AssistView Example - Text To Speech

Loading Syncfusion Blazor Server Demos…
This demo passes automated axe checks with 0 violations — semantic markup, ARIA, full keyboard operation, visible focus. Section 508 conformant Accessibility report VPAT
What is AI?
AI stands for Artificial Intelligence, enabling machines to mimic human intelligence for tasks such as learning, problem-solving, and decision-making.

This sample demonstrates the integration of Text-to-Speech with the AI AssistView component, enabling users to convert AI-generated responses into spoken audio via the browser’s Web Speech API for voice-based interaction.

Key Features:

  • The ResponseToolbar includes a custom Read Aloud button that extracts plain text from the AI response and uses the browser's SpeechSynthesis API to vocalize it.
  • The SpeechSynthesisUtterance interface is used to manage speech playback, including toggling between play and stop states.
  • The AssistViewToolbar adds a right-aligned Refresh button to clear previous prompts.
  • Responses are streamed dynamically using the UpdateResponseAsync method, and the ScrollToBottomAsync method ensures the latest response is always visible.