Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Text To Speech Using C#
WhatsApp
Pankil Bhatt
9y
3.3
k
0
0
25
Blog
This code-sample includes add Text to speech. This sample can be used for many purpose. For example, you can create an captcha speech.
Here is the code
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<asp:TextBox ID=
"txtWord"
runat=
"server"
/>
<asp:Button ID=
"btnSubmit"
runat=
"server"
Text=
"Speack Word"
OnClick=
"btnSubmit_Click"
/>
</div>
</form>
</body>
Need to add this library file on code behind
using
SpeechLib;
Wirte C# code in the Button_Click event.
protected
void
btnSubmit_Click(
object
sender, EventArgs e)
{
//Create Voice Object
//Add text for speach
SpVoice voice =
new
SpVoice();
voice.Speak(txtWord.Text);
}
Build the application and you can hear the voice.
Up Next
How To Apply Cell Text & Background Color In An Excel Sheet Using EPPlus (C#) - Part Two
Ebook Download
View all
Beginning C# Object Oriented Programming
Read by 35.6k people
Download Now!
Learn
View all
Membership not found