On Windows OS, you will find the COM automation object SAPI.SpVoice that brings TTS (Text-To-Speech). The following shows an example of using SAPI to speak given a sentences. By default, only English voice library is installed, you have to install languages of your choices if you want the computer speak your native languages.
1 2 3 4 5 6 7 | Set voice = CreateObject("SAPI.SpVoice") voice.Rate = 1 voice.Volume = 90 Say = InputBox("Say Something", "Say Something", "I Love you!") If (Len(Say) > 0) Then voice.Speak Say End If |
Set voice = CreateObject("SAPI.SpVoice") voice.Rate = 1 voice.Volume = 90 Say = InputBox("Say Something", "Say Something", "I Love you!") If (Len(Say) > 0) Then voice.Speak Say End If
The above VBScript pops up a dialog with the default sentence I love you! to say. Input your sentence and press OK, the computer will read that loud!
More properties can be found in MSDN. Try it yourself, simply save the above into a *.vbs script and let me know the gender of your computer!
You can specify the male/female voice engines in Control Panel under Speech section.
Which gender is your computer? Comment below.
References:
1. http://msdn.microsoft.com/en-us/library/ms723602(v=vs.85).aspx
–EOF (The Ultimate Computing & Technology Blog) —
loading...
Last Post: Codeforces: 300A. Array
Next Post: Check A Date String If Weekend In Java
Mine is transgender 🙂
Mine still came out male
using windows 10
You can specify the male/female voice in Control-Panel-Speech