Make a text to speak program

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
16 posts Page 1 of 2
User avatar
shabs
Just Registered
Just Registered
Posts: 3
Joined: Mon Jun 07, 2010 6:35 am

Make a text to speak program
shabs
Hi everyone,
Today i am going to show how to make your program speak...
You need
1 Label (name it "Enter the text to be spoken")
2 buttons (button "Speak" and button 2 "Hello")
1 Text Box

Add this code to the bottm of Public Class Form1
Code: Select all
Dim SAPI = CreateObject("SAPI.spvoice")

Now add the following code to Button 1
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SAPI.speak(TextBox1.Text)
End Sub
Now add the following code to Button 2
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SAPI.speak("Hello")
End Sub
Thank you Codenstuff and thankyou friends

Regards
Shahbaz
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Make a text to speak program
mandai
You can also do this by referencing System.Speech.Synthesis:
Code: Select all
        Dim ss As SpeechSynthesizer = New SpeechSynthesizer()
        ss.Rate = 1 'speed
        ss.Volume = 100
        ss.SpeakAsync("test")
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Re: Make a text to speak program
zachman61
how does yours work mandai how can you do the code
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Make a text to speak program
mandai
How do you do what? Just add the .Net System.Speech reference to your project, put this code in one of your events and import the System.Speech.Synthesis namespace.
User avatar
Cheatmasterbw
Coding God
Coding God
Posts: 1506
Joined: Fri Jan 01, 2010 2:30 pm

how would i change the volume, speed, voice, etc. (in the SAPI Variable)?
http://www.megaapps.tk/
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Make a text to speak program
mandai
Check out http://msdn.microsoft.com/en-us/library ... S.85).aspx
There are volume, rate and voice properties that you can change.
User avatar
Proprogrammer
VIP - Donator
VIP - Donator
Posts: 415
Joined: Sun Oct 03, 2010 11:14 pm

yeah this is a pretty simple code that everyone pretty much knows except of course the noobs but great job on the tut.
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Make a text to speak program
Usman55
Hello everyone,

I have also made a tutorial on a TTS Reader application. You can find it here: viewtopic.php?f=38&t=3908 It's more advanced than this. And also great job shabs!
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Make a text to speak program
Usman55
Hello everyone,

I have also made a tutorial on a TTS Reader application. You can find it here: viewtopic.php?f=38&t=3908 It's more advanced than this. And also great job shabs!
Image
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Make a text to speak program
M1z23R
Can you add some other language to it ? For example, have a combobox with languages, and select for example France... so it can read the like France does ;) I think you understand me ! it speaks the with English gramer !
16 posts Page 1 of 2
Return to “Tutorials”