Convert Text to Speech in .NET [C#]

Text to Speech

In .NET it is very easy to convert a given text into a Speech which can be heard from the speaker (provided it is connected to the machine). The process is very simple and is defined in the following steps (NOTE: the following code has been written for Windows Form):-

    • Add the reference of System.Speech


    • Add the reference of Microsoft Speech Object Library from the COM.


    • This is what I have designed as the user Interface for this Program


    • Now on the Click Event of the button Text to Speech add the following code (SpeechSynthesizer Class is defined within the namespace using System.Speech.Synthesis)
      SpeechSynthesizer synths = new SpeechSynthesizer();


  • Finally, run the application and the text that you will type in the textbox can be heard from an attached speaker once the button Text to Speech is clicked.

SpeechSynthesizer provides access to the functionality of an installed a speech synthesis engine. More info can be found here




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.