VB6 Text To Speech Application
Pre-Requisite: Make sure that you system already has TTS (SAPI – Win32 Speech API) is installed.
If it is not installed, download & install it from this link. Microsoft Speech SDK or Win32 Speech API Download
Once this is installed successfully, the below code can be used in your VB projects.
VB6 Code – Text To Speech Application
Here is the simplest code with late binding or dynamic binding that refers TTS.VB6 Code for Text to Speech - Voice Output MessagesVisual Basic12345678910Sub Excel_Text_To_Speech_Late_Biding()'Object for TTSDim obj_Text_To_Speech_Voice'Refer SAPI objectSet obj_Text_To_Speech_Voice = CreateObject("SAPI.spVoice") 'Microsoft Speech SDK'Text To Speech - Voice Text Messageobj_Text_To_Speech_Voice.Speak "hi how are you?" ' Voice Text To SpeechEnd Sub
Include the above code in any of your project & call this from a command button.
The computer will give the voice command entered in the code.
In case you would like to know more options inside this SDK, try this code.
Note: Include “Microsoft Speech Object Library from references before executing this code.VB6 - SAPI - TTS CodeVisual Basic12345678910Sub Excel_Text_To_Speech_Early_Biding()'Object for TTS or Win32 Speech API - SAPIDim obj_Text_To_Speech_Voice As SpeechLib.SpVoice'Create instance for SAPI objectSet obj_Text_To_Speech_Voice = New SpeechLib.SpVoice'Text To Speech - Voice Text Messageobj_Text_To_Speech_Voice.Speak "hi how are you?" ' Voice Text To SpeechEnd Sub
Output will be the same for this code also.
You can also further modify this code to read text from a file or filestream, choose speaker (make or female voice), control volume, speed at which the text is read out.
Text To Speech Application – VB6 Voice Code
- Games VCF Countif Record Macro Timer in Excel Task Manager print screen HTML Table Import Data Thumbnails Text to Speech TTS Candy Crush Block Apps in FaceBook C++ Programing Machine learning AI bulk email Excel VBA vba color index vba color codes Android social media Twitter Google+ Google Adsense Tips bitcoin Calendar in Excel outlook vba mass email Data Mining Excel Macro Facebook WhatsApp python Wordpress