Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 426

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/templates/ja_purity/ja_templatetools.php on line 49
Text to Speech in C# - The Scripts Library Community

Free Programming Tutorials & Source Code

 
  • Increase font size
  • Default font size
  • Decrease font size
Home C# Text to Speech in C#

Text to Speech in C#

E-mail
(1 vote, average: 5.00 out of 5)
This sample tutorial shows how to use the Microsoft Object Library component to build a Text to Speech application.

First, create a form; add the following controls to it:

TextBox. Set the name as txtText, and Multiline property to True.
Button. Name it as btnRun, Caption Run.
In the project explorer, right click on references. Click on the COM tab. choose Microsoft Speech Object Library, then click ok.

test speech

Add the following code to your form:

  using SpeechLib;

and the btnRun_Click  event:

  private void btnRun_Click(object sender, EventArgs e)
        {
            SpVoiceClass v;
            v = new SpVoiceClass(); // create SpVoiceClass instant
            v.Rate = 1;// set rate as 1
            v.Speak(txtText.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync); // text to speech
        }


Happy coding!