This is my another tutorial in VB.NET that converts an inputted text into a speech or voice. We will just only call the Speech API namespace for this program and with the use of Spvoice object. The SpVoice object brings the text-to-speech (TTS) engine capabilities to applications using SAPI automation. An application can create numerous SpVoice objects, each independent of and capable of interacting with the others. A SpVoice object usually referred to simply as a voice, is created with default property settings so that it is ready to speak immediately.So, now let's start this tutorial!
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim tts = CreateObject("SAPI.spvoice")
- End Sub
We have initialized a tts variable to create an object of SAPI.spvoice. A SAPI.spvoice is created with its audio output set to the system default audio output. It also determines what other outputs are available to the voice, and use another property to set its audio output to one of them.
The Speak method here places a text stream in the TTS engine's input queue of our inputted text in TextBox1 and returns a stream number. It can be called synchronously or asynchronously. When called synchronously, the Speak method returns immediately, and the voice speaks as a background process.
You can also download the source code below and try it! :)
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.Best Regards,
Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Visit and like my page on Facebook at: Bermz ISware Solutions
Subscribe at my YouTube Channel at: SerBermz
Visit my website at: CampCodes