C# Text To Speech Application Using WPF



Hello Friends ... .!!
This is The First Project I'm Posting About 
C# WPF ( Windows Presentation Foundation ).
It is just a simple Project That Takes The Text You Write In A Text Box And Spell It by A Male Or Female Voice .. However You Want ..
At The End Of the Post You Will Find A Download Link For The Working Project With It's Source Code Uploaded To Media Fire .



Before You Run To Download The Project and Try it out I need you To Know How I Did It , So When You Are Planning To Implement The Code Yourself , You Wont Feel That I Did Something Magical Or Such .. :)

Steps To Create A TextToSpeech Application :

  1. Open Visual Studio and Create A New Project From C# List Select WPF Windows Application.
  2. Design The Form by Adding Two Radio Buttons , TextBox and A Button.


  3. From The Project List Click On Add Reference

  4. Find From The List System.Speech

  5. Now Add The Namespace using System.Speech.Synthesis; 
  6. Create instance of Synthesis , Synthesis Sound = new Synthesis();
  7. Add This Code To The btnSpeak_Click Event
            try
            {
                if (RadioMale.IsChecked == true)
                {
                    voice.SelectVoiceByHints(VoiceGender.Male);
                }
                else
                { voice.SelectVoiceByHints(VoiceGender.Female); }

                voice.SpeakAsync(txtToSpeech.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


Now Try It out and Have Fun :)


Click Hear....!!

    Previous
    Next Post »
    Thanks for your comment