wpf

Speech Synthesis

Introduction#

In the System.Speech assembly, Microsoft has added Speech Synthesis, the ability to transform text into spoken words.

Syntax#

  1. SpeechSynthesizer speechSynthesizerObject = new SpeechSynthesizer();

    speechSynthesizerObject.Speak(“Text to Speak”);

Speech Synthesis Example - Hello World

using System;
using System.Speech.Synthesis;
using System.Windows;

namespace Stackoverflow.SpeechSynthesisExample
{
        public partial class SpeechSynthesisSample : Window
        {
                public SpeechSynthesisSample()
                {
                        InitializeComponent();
                        SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
                        speechSynthesizer.Speak("Hello, world!");
                }
        }
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow