MY bLOG

Wednesday, 13 November 2013

speech recognition

Speech recognition :
This article will explain  how to convert entered text into speech format so here i will explain speech recognition using asp.net.

At first we have to create a single web application and then ->Add New Item in Solution Explorer

and then you have to add reference for speech library which was shown in above

We have to add reference at COM and select Microsoft Speech Object Library and click on Ok.
The speech library is added to our reference
Then at first we have to add namespace like using SpeechLib;
create an object of spvoice class in .aspx page.
 <table>
<tr>
<td>Type your Text:</td>
<td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
    <td><asp:ImageButton ID="ImageButton2" ImageUrl="~/images/download.jpg" 
            AlternateText="sppech" runat="server" Height="25px" Width="25px" 
            onclick="ImageButton2_Click" /></td>
</tr>
</table>
Write below code in.aspx.cs page in a button click event
 protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            SpVoice sp = new SpVoice();
            sp.Volume = 100; 
                sp.Speak(TextBox1.Text);
        }

write some text in textboxand then click on image button  to convert text into speech converter.
I hope you  understand the concept of speech recognition.

No comments:

Post a Comment