Wednesday, June 5, 2013

Windows application for converting Text into Speech.

Hi Friends, in this post I would like to explain how to convert Text into Speech.




· Open windows application.
· Place a TextBox & a Button control on to the form.
· Goto ProjectMenu---> Add Reference---> COM---> MicrosoftSpeechObjectLibrary (Add this reference).
· Add the following namespace: using SpeechLib;
Please go through the code under button click event:



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SpeechLib;


namespace TextToSpeech
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


private void btnClick_Click(object sender, EventArgs e)
{
SpVoice voice = new SpVoice();//Where SpVoice is the Speakers Voice.
voice.Speak(textBox1.Text,SpeechVoiceSpeakFlags.SVSFDefault);
}
}
}






Thank You...

0 comments:

Post a Comment