loading
Hi, friendly neighborhood Super_Nerd here. As my first instructable I will show how to make a simple vbs script that reads the time and date with the narrorator. You will need:

-a computer running Windows 95 or higher (won't work on Macs sorry macs :( )
-notepad
-ability to copy and paste
-a brain (sorry jellyfish)

Step 1: A Pad of Notes

First open notepad

Windows 95-2000
Start>Programs>Acessories>Notepad

Windows XP-7

Start>All Programs>Acessories>Notepad

Once you have notepad open go onto the next step.

Step 2: The Code!

 Copy and paste this code:

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")


Sapi.speak weekdayname(weekday(date))
Sapi.speak monthname(month(date))
Sapi.speak day(date)
Sapi.speak year(date)
Sapi.speak "Is the current date."
Sapi.speak "The current time is"


if hour(time) > 12 then
Sapi.speak hour(time)-12
else
if hour(time) = 0 then
Sapi.speak "12"
else
Sapi.speak hour(time)
end if
end if


if minute(time) < 10 then
Sapi.speak "o"
if minute(time) < 1 then
Sapi.speak "clock"
else
Sapi.speak minute(time)
end if
else
Sapi.speak minute(time)
end if

if hour(time) > 12 then
Sapi.speak "P.M."
else
if hour(time) = 0 then
if minute(time) = 0 then
Sapi.speak "Midnight"
else
Sapi.speak "A.M."
end if
else
if hour(time) = 12 then
if minute(time) = 0 then
Sapi.speak "Noon"
else
Sapi.speak "P.M."
end if
else
Sapi.speak "A.M."
end if
end if
end if

Step 3: Saving

After you copied the code we must save it. Go to
File>Save As

You can name it anything you want but it just has to end with the .vbs file extention or this in simple terms
Won't work.

Step 4: You're Done!

Well that wasn't so hard, was it? Now open your file...
Don't be spooked if it says the date and time. Thanks goes to SCRIPTmaster for this  instructable that tought me how to use SAPI in scripts. Now go and put this in your robot or whatever.

Note: I am not responsible if your script goes wrong. You should have copied and pasted it in the first place. If when you try to run your script it gives you an error message try recopying the script. If that still doesn't work leave a comment and maybe we all can figure it out.

100 0010 111 1001 110 0101
<p>Btw where can i put this line &quot;&lt;pitch middle='15'&gt;&quot; on this script <br>I want to change the voice pitch<br>{Set voice = CreateObject(&quot;SAPI.SpVoice&quot;)</p><p>voice.Rate = -2</p><p>Voice.Volume = 100</p><p>voice.Speak&quot;&lt;pitch middle='15'&gt;&quot;&quot; Good Morning&quot;}<br></p>
<p>The best way to figure these things out is to just try them and see for yourself. After looking into it (I haven't done VBS in years), it looks like that should work in the range [-25, 25].</p>
<p>Ah I mean where i can put those line in this &quot;VBS to read time&quot;<br>i try to put my VBS script on &quot;Sapi.speak minute(time)&quot; into <br>&quot;Sapi.speak&quot;&lt;pitch middle='15'&gt;&quot; minute(time) and got error </p>
<p>You probably ran into an error because that wasn't concatenated. For the sake of simplicity, give the pitch its own line before you have it read the minutes separately on the next line.</p><p>Sapi.speak &quot;&lt;pitch middle=15&gt;&quot;</p><p>Sapi.speak minute(time)</p>
<p>or is just impossible =_= i try that but still here i post the picture as well hope can help </p>
<p>Sorry, that was my bad. From what I can tell in how you're using the SAPI object (I've never used this functionality myself, which explains why I forgot this), the 15 in</p><p>Sapi.speak &quot;&lt;pitch middle=15&gt;&quot;</p><p>should be surrounded by apostrophes like this</p><p>Sapi.speak &quot;&lt;pitch middle='15'&gt;&quot;</p><p>My guess is that it's just how the SAPI parser reads it, but I can't be certain. Hope that helps. </p>
amg!! ty so much!! i used this over and over cuz' it's so fun to do!!!!!!!!!!!!!!!!!!!!!!!!!!!! thankyouthankyouthankyou (p.s. my friends are talking about weird stuff in the background right now like smarty parties O.o)
worked! but sound robotic..
This is a really cool script! Thanks for posting it!
how did you get to the speech properties?
Start&gt;Control Panel&gt;Speech
thanks!
Nice script. <br><br>The only change I made was instead of saying every string as it was determined, I built a bigger string as the script executed, then at the very end issue one command to say that string. For example, instead of <br><br>Sapi.Speak hour(time)-12<br><br>I used <br><br>strSapi = strSapi &amp; &quot; &quot; &amp; hour(time)-12<br><br>and the last line of the script was:<br><br>Sapi.Speak strSapi<br><br>Made for a smoother output plus it works faster because you only need to make the speech api call once.<br><br>Also, my 'puter kept changing A.M. to &quot;A meters&quot;, go figure, who'd a thunk the auto abbreviation expansion would go metric for my locale. I just changed that part of the string to be &quot;A. M&quot;, adding a space before the M and removing the last period.<br><br>Nice to have this little script in my toolbox, I'm sure it will be useful down the road.<br><br><br>Jim<br><br><br>/* If you think the problem is bad now, wait until I fix it! */<br><br>
I never knew that because I don't understand string commands. Thanks! :) BTW did you ever notice how it would say things like February two instead of February second? Thats gonna be one long if then else end if statment. :P About A.M. my speech engine doesn't do that. ? Well at least you could fix it on your own. ;)

About This Instructable

9,145views

6favorites

License:

Bio: I find a quote from Bill Gates makes a very good description. "Be nice to nerds. Chances are you'll end up working for one."
More by Super_Nerd:Make an assistant for your computer in 5 minutes Track Computer Usage in 2.5 minutes How to be a MAD Scientist! MU-AH HA HA HA! 
Add instructable to: