3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Make your windows XP talk!

Make your windows XP talk!
This instructable shows you how to write a simple vb script that allows you to use the microsoft SAPI
(Speech application Programming Interface).

quick version history of the SAPI in windows:
SAPI 1.0 - 1995
SAPI 2.0 - 1996
SAPI 3.0 - 1997
SAPI 4.0 - 1998
SAPI 5.0 - 2000
SAPI 5.1 - 2001
SAPI 5.2 - 2004
SAPI 5.3 - With Windows Vista

Windows XP and Windows Server 2003 come with Microsoft Sam but you can also download Microsoft Mary and Microsoft Mike. To find which ones you have installed you can run this Vbs script:

Set objVoice = CreateObject("SAPI.SpVoice")

For Each strVoice in objVoice.GetVoices

Wscript.Echo strVoice.GetDescription

Next

 
Remove these adsRemove these ads by Signing Up
 

Step 1The first step...

The first step...
Open up notepad, and write the following vbscript in it:

Dim userInput

userInput = InputBox("Type below anything to hear you PC speak it!")

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

Sapi.speak userInput

==> the second line allows the showing of the input box in which the user will enter his sentence that is to be read by the pc
==> the first line declares the variable userInput
==> the third line declares the SAPI and creates its object
==> and the last line tells the SAPI what to readwhich is in this case the variable userInput
« Previous StepDownload PDFView All StepsNext Step »
59 comments
1-40 of 59next »
Feb 16, 2010. 5:56 PMmc_dude says:

delete the XXXXX and add your name to make it look legit!
--------------------------------------------------------
 

msgbox ("Made by XXXXX!")

do

set wshshell=wscript.createobject ("wscript.shell")

strInput = InputBox("Type Bellow, To Hear It Spoken!", "text to talk")

If strInput = False Then
WScript.quit
Else
If Len(StrInput) = 0 Then
WScript.Echo "You did not enter anything. Try again"
Else

Dim userInput
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
Sapi.speak strInput

End If
End If

loop
-------------------------------
save it AS     talkit.vbs

Feb 16, 2010. 5:59 PMmc_dude says:

the loop is not a bad loop (by the way) if you push cancel and the x button it will close it...... and if you type nothing and lick ok it will propt you to actually type sommething than let you try again. made completly by me    =)

Apr 15, 2011. 11:38 AMwill421 says:
I've been licking okay, but nothing happened!
Is there something wrong with my monitor?
Do you have to have a proprietary tongue?
Do I have to upgrade to Windows 7?
Oct 28, 2011. 7:32 PMwill421 says:
Okay, I have upgraded to Windows 7, but it still doesn't work.
Can some one help me? I must know where I fix this problem where licking okay doesn't do anything!
Sep 6, 2011. 5:39 PMwill421 says:
I'm using this in a spelling test program for my teacher.
:D
Aug 2, 2011. 8:00 AMSuper_Nerd says:
Is there a way to make it listen from Speech recognition? The only way I've done it is make it open the SR program and create an Input box
Aug 7, 2009. 2:36 PMdavidprosser says:
If you want to make it speak when you click on the file, and have no box come up (like a mysterious voice) then use this code:

Dim userInput

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

Sapi.speak "Whatever you want to say"
Aug 7, 2009. 2:41 PMdavidprosser says:
In fact I've improved on it - It will now delete itself once it has said the message - try out this code:

Dim userInput

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

Sapi.speak "Boo! I bet I really freaked you out! But don't worry, it's

about time a computer like myself could speak! Goodbye!"

Dim objFSO
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the currently executing script
objFSO.DeleteFile WScript.ScriptFullName
Set objFSO = Nothing
Aug 2, 2011. 7:58 AMSuper_Nerd says:
You don't need the userinput variable.
Feb 15, 2011. 1:04 PMSuper_Nerd says:
I made this at school and turned my volume up and made it say...

Mamby Pamby Land tastes like cheese oh my I forgot to get brocolli for the cheese.

Feb 2, 2011. 5:32 PMSuper_Nerd says:
Hey, I put this into a program that reads the time. Try this link.
Dec 6, 2010. 3:36 PMwill421 says:
I made a nice little script out of this one:
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
WScript.Sleep(1000)
Sapi.speak "Hello."
WScript.Sleep(500)
Sapi.speak "My name is Sapi."
WScript.Sleep(700)
Sapi.speak "How are you?"
WScript.Sleep(1000)
Sapi.speak "I'm good too."
WScript.Sleep(400)
Sapi.speak "Have a nice day!"
WScript.Sleep(400)
Sapi.speak "Oh, and by the way, this script was made by will 421 also known as DabatchSquad, Dabatch, and will 4210"
WScript.Sleep(500)
Sapi.speak "I will write down the usernames for you in notepad. Here..."
WScript.Sleep(400)
WshShell.run "notepad"
WshShell.appActivate "Notepad"
WScript.Sleep(500)
WshShell.SendKeys "will421"
WScript.Sleep(500)
WshShell.SendKeys "{ENTER}DabatchSquad"
WScript.Sleep(500)
WshShell.SendKeys "{ENTER}Dabatch"
WScript.Sleep(500)
WshShell.SendKeys "{ENTER}will4210"
Sapi.speak "There. Goodbye!"
Jan 31, 2009. 4:54 PMGIVECASH says:
Do I Write the stuff in parenthesis
Feb 10, 2010. 6:32 PMGeekBeam says:
yes
Mar 20, 2009. 12:15 PMfatboy106 says:
mine just comes up: windows script host line:4 char:1 error:expected statement code:800a0400
Feb 10, 2010. 6:32 PMGeekBeam says:
are you doing it on one line if so use the way he said up there except don't include the space in between
Oct 1, 2009. 1:53 AMsushantparab says:
great
Sep 6, 2009. 3:28 PMfiresketch says:
Fantastic images, well done. I need to work on my illustration :/
Jul 6, 2009. 2:49 AMalexman695 says:
cool
Jun 15, 2009. 7:54 PML0rd0fferret says:
how do you change to othervoice i have all three
May 31, 2009. 6:58 PMcheesefetty says:
you can also go to control panel, then go to speech then VIOLA!!
Apr 25, 2009. 8:44 PMhg341 says:
nice i now know a bit of .vbs
Mar 12, 2009. 8:48 AMslu6alka says:
Ha this is awesome:) Do you know how to make it speak in other language?
Feb 24, 2009. 4:10 PMBert99 says:
I showed it to a bunch of teachers at my school and they loved it!
Jan 31, 2009. 9:56 AMknoxarama says:
this works well. all you really have to do is copy/paste anyway. but i have something to add. when the box pops up, put ------------------ between all of your words. its makes the computer stop between words, otherwise it goes really fast.
Jan 31, 2009. 9:24 AMknoxarama says:
this is weird! and it works!
Jan 26, 2009. 10:26 AMReCreate says:
"self destruct sequence initiated"...funny that part made me laugh
Jan 9, 2009. 6:53 PMkttecatt says:
I know this will probably sound like a stupid question, but, I am not very computer savvy. When you say, " just double click on the script file and the program will run were you will enter yousentence and the pc will read it!", what exactly does that mean? What is a script file? Thanks, =.=
Nov 24, 2008. 12:14 AMblugyblug says:
Another way is Control Panel --> (category view)--> sounds, speech and audio devices --> (normal view)-->Speech --> At the top click the tab that says "text to speech" Now select a voice, some of them sound really weird. And type inside the box and click preview.
Nov 23, 2008. 2:30 PMwenpherd says:
how do you chang the voice, and can you make it so it responds when you talk to it i think you should try it
Nov 23, 2008. 2:23 PMwenpherd says:
this remind me of wargames it cool movie
Nov 18, 2008. 1:04 PMstephen2803 says:
lol, this is realy good!thank you, do some more!
Nov 12, 2008. 12:06 AMQwertyuioLP says:
I've got a new code for this:

Dim userInput

userInput = InputBox("Type below anything to hear you PC speak it!")

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

Sapi.speak userInput
x=msgbox("Message here!!",vbBeep,"title here")

hope you like
Nov 13, 2008. 1:59 PMTATcreator says:
How is it supposed to work? We don't specialize in vbscripting, only batch.
Nov 17, 2008. 12:11 AMQwertyuioLP says:
All it does is speaks and then a pop up, pops up(bet u don't see that every day!)
Sep 6, 2011. 5:42 PMwill421 says:
Dec 6, 2010. 3:21 PMwill421 says:
Can you do stuff in a console that looks like its from wargames in VBS?
No.
Can you do stuff in a console that looks like its from wargames in Batch?
Yes.
1-40 of 59next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
5
Author:SCRIPTmaster