Today I'm going to teach you how to make your windows computer to speak current Time. To do this we need to create a "VBS(Visual Basic Script)" file. Its very simple. Fallow these Steps...
1. Open Notepad.
2. Type fallowing code in it.
Dim H, M, T
Set MBH = Wscript.CreateObject("SAPI.SpVoice")
if hour(time) > 12 then
H = hour(time) - 12
elseif hour(time) = 0 then
H = "12"
else
H = hour(time)
end if
if minute(time) < 10 then
if minute(time) < 1 then
M = "o'clock"
else
M = "o" & " " & minute(time)
end if
else
M = minute(time)
end if
if hour(time) = 12 then
T = "noon"
elseif hour(time) = 0 then
T = "Midnight"
elseif hour(time) > 12 then
T = "P.M."
elseif hour(time) < 12 then
T = "A.M."
end if
MBH.speak "Current time is, " & H & " " & M & " " & T
3. Go to "File ---> Save As..."
4. Enter any name you want.
5. Save it as ".vbs" extention(Set "Save As type" to "All Files" and "File Name" to
6. Go to the place where you save the file and just double-click it.
Hooray....! Now your computer can say current Time.
0 comments:
Post a Comment