Aside from my Text-To-Speech Application in Android and VB6, I also created another tutorial in VB6 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.
Now, let's start this tutorial!
1. Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open
Microsoft Visual Basic 6.0, click
Choose Standard EXE, and click
Open.
2. Next, add one TextBox named Text1 for inputting a text to become a speech, and add one button named Command1 to convert the inputted text into speech. Design your interface like this one below:
3. On the
Project tab menu, click
References.
4.
Find Microsoft Speech Control Library, and then check it.
5. Now put this code for your code module.
Private V As SpeechLib.SpVoice
Private Sub Command1_Click()
V.Speak (Text1.Text)
End Sub
Private Sub Form_Load()
Set V = New SpeechLib.SpVoice
End Sub
We have declared variable V as
SpeechLib.SpVoice which was found under
Microsoft Speech Control Library. 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. An
SpVoice object, usually referred to simply as a voice, is created with default property settings so that it is ready to speak immediately. The
Speak method places a text stream in the TTS engine's input queue and returns a stream number. It can be called synchronously or asynchronously. When called synchronously, the Speak method does not return until the text has been spoken; when called asynchronously, it returns immediately, and the voice speaks as a background process. The
Speak method initiates the speaking of a text string, a text file, an XML file, or a wave file by the voice.
Download the source code 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 Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:
[email protected]
Add and Follow me on Facebook:
https://www.facebook.com/donzzsky
Visit and like my page on Facebook at:
https://www.facebook.com/BermzISware