|
| 14 Jul 2012 02:30 AM |
This is a little tutorial that explains how to do this.
To get started, open up Notepad.
Then, copy-paste this code in (Don't worry, I'll go over it):
Dim talker Set talker = CreateObject("Sapi.spvoice") talker.Speak "Hello again"
Now the hard part.
Click on File > Save.
Now, the hard part.
In the address bar (The text box on the top of the save window) type in %appdata% and press enter. From there, you want to find the folder called Microsoft. Click it. Now find the folder called Windows. Click it. Inside Windows, search for the folder called Start Menu. Click it. Finally, find the folder called Programs. Click that.
Almost done!
Your final task is to find the folder called Startup and click that, too.
Now, save the file as hello.vbs and MAKE SURE to change "Save as type" to "All Files".
Congratulations, you did it! Now, let me explain everything:
There's a special folder in Windows called Startup. Anything in this folder gets executed when you log in. That means that the little program we made will be started as soon as we log in.
Speaking of the program, let's explain that.
Dim talker -- This line makes a variable, where we can store values Set talker = CreateObject("Sapi.spvoice") -- This will be explained later talker.Speak "Hello again" -- This makes your computer say "Hello again"!
Set talker = CreateObject("Sapi.spvoice")
That's a complex line to follow, so I'll break it up into bits.
[Set talker] = CreateObject("Sapi.spvoice")
Set talker is basically saying that we're about to put something into talker.
Set talker = [CreateObject]("Sapi.spvoice")
The scripting language we're using is VBS - short for Visual Basic Script. CreateObject basically does just that, it creates an object.
Set talker = CreateObject("[Sapi.spvoice]")
Sapi.spvoice sounds really confusing, but it's really not. Basically it's this thing that Microsoft made that lets your computer speak. As in words. As in, actual English coming from your computer. It's really cool.
So basically what this line does is set up a virtual voice and assign it to talker.
Customization ---------------
This is the only line I recommend you customizing:
talker.Speak "Hello again"
talker.Speak basically tells the voice to speak what's in the "" marks. So when this is run, you'll hear "Hello again" in a computer voice. You can, of course, add more of these to make a better greeting:
talker.Speak "Hello again" talker.Speak "How have you been?" talker.Speak "Very nice weather we're having"
If you want even more, you can add pauses so it looks like the voice stops before it continues speaking again, as if it's thinking.
This is accomplished by the following code:
Wscript.sleep 1000
The 1000 means how long the script should wait. That's in milliseconds. Remember that 1 second = 1000 milliseconds, so we're pausing the script for 1 second basically.
You could combine this with Speak and a for loop to get a really cool countdown:
For count = 10 To 0 Step -1 talker.Speak count Wscript.sleep 1000 Next
This will repeat 10 times, and it will say the number it is repeating.
The logic:
Count is the amount of times it has repeated. The first time, count is 10. Each iteration (time the for loop is restarted) the count goes down by 1. The loop is restarted every second, because we have it pause. When it reaches 0, the loop ends and nothing else happens.
I'd love to see what you guys can do with this. Got any problems/questions/suggestions? Just PM me or post it here - I'll try to reply ASAP. |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 02:37 AM |
| I love doing this on a friend's PC and making it say "You will die tomorrow!" |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 02:40 AM |
| This sounds pretty cool, I think I'll try it. |
|
|
| Report Abuse |
|
|
lmb32
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 63 |
|
|
| 14 Jul 2012 02:44 AM |
| Ah vbs, you can do pretty cool things in almost no time, vb was the first language I learned, but I have forgot good part of it because I don't practice it since eons. |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 02:46 AM |
| @lmb Same as me! I don't use it at all any more though. There are much better alternatives. I still have an old MSVS 2005 express disk, lol. And yeah VBS is freaking awesome once you get it under your belt. I just wish you could make it cross-platform so it works on Linux too :) |
|
|
| Report Abuse |
|
|
lmb32
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 63 |
|
|
| 14 Jul 2012 02:50 AM |
| Yeah, it works for basic things, even the name tells you that lol, but it's a good alternative to simple things, you know interpreted language, easy syntax. Conclusion it's a good language to get you into the programming world. |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 02:53 AM |
Wonder if there's an API to detect human speech...
Google to the rescue <3 |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jul 2012 03:01 AM |
Dim talker Set talker = CreateObject("sapi.spvoice") talker.Speak "Wouldn't it be better not to die?"
:3 |
|
|
| Report Abuse |
|
|
lmb32
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 63 |
|
|
| 14 Jul 2012 03:02 AM |
| Muahahaha it looks like I'm a better googler than you >:3, google Microsoft tellme |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 01:29 PM |
| tellme isn't for VBS..muahaha fail google search is fail |
|
|
| Report Abuse |
|
|
lmb32
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 63 |
|
| |
|
|
| 14 Jul 2012 05:29 PM |
VBS != VB.NET
Although this would've been awesome to use if I still used VB.NET. |
|
|
| Report Abuse |
|
|
Trollol1
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 149 |
|
|
| 14 Jul 2012 05:38 PM |
| Tryed and it is amazing nuff said |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 14 Jul 2012 05:39 PM |
Maek it say "u r turning me on"
Ololololol |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 14 Jul 2012 05:42 PM |
Really cool. Dim talker Set talker = CreateObject("Sapi.spvoice") talker.Speak "Hello, my master!" |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 14 Jul 2012 05:44 PM |
@su8 "u r turning me on" hawt |
|
|
| Report Abuse |
|
|
lmb32
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 63 |
|
|
| 14 Jul 2012 05:50 PM |
Vut you neva specified that you wanted it for vbs D:
"Wonder if there's an API to detect human speech..." |
|
|
| Report Abuse |
|
|
liavt
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 1241 |
|
|
| 14 Jul 2012 06:15 PM |
| Works! I made mine say Welcome back, Master Liavt! |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 10:16 PM |
@lmb
True, true...
@liavt
Lol that's cool I made mine say "Welcome back. I hope I don't crash and burn today." |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jul 2012 03:16 PM |
| Error: ActiveX component can't create object |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2012 05:40 PM |
You did do Sapi instead of sapi, right?
Also, what OS are you using? |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2012 07:08 PM |
bawmp
I want everyone to see this. I WILL RULE TEH SH!!! |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2012 05:56 PM |
| @Tech - I copied and pasted. I'm running Windows 7. |
|
|
| Report Abuse |
|
|