Make Your Windows XP Talk!

Introduction: 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

Step 1: 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

Step 2: Save You Work...

now after entering the script you have to save it in the form of vbs file
click save and write in the place were you name you file:

the name that you want.vbs

*remark: i mean by "the name that you want" the naming that you are free to put for your file

after you save, just double click on the script file and the program will run were you will enter yousentence and the pc will read it!

good luck
hope you like this instructable
please do make a comment, thanks ;)

Participated in the
The Instructables Book Contest

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    59 Discussions

    0
    KindelQ
    KindelQ

    5 years ago on Introduction

    Here is another text and instructions. This will repeat unless you get rid of 'do' and 'loop'.

    Code Below and Above Dotted Lines

    -------------------------------------------------------------------------------------------------------------

    Set speech=CreateObject("sapi.spvoice")

    Dim speaks, speech

    do

    "Anything here minus quotations and spaces"=("What the computer says.")

    speech.Speak "Anything here minus quotations and spaces"

    loop

    ----------------------------------------------------------------------------------------------------------

    (For hidden files (http://www.bleepingcomputer.com/tutorials/show-hidden-files-in-windows-7/) (Works for more than windows 7)

    Then go to Users/Your_Username/App_Data/Roaming/Microsoft/Windows/Start_Menu/Programs/Start_Up. Then drag the program (Saved the same way in the instructable) to that folder. Whenever you start your file, the program will run.

    If you have do loop, to end it, got to task manager, process, and end wscript.exe

    Thank You

    0
    jkirby5
    jkirby5

    6 years ago on Introduction

    If you get rid of the input box and put the script in the startup folder you can scare coworkers and friends pretty good. I've got a similar how-to on my site with the appropriate changes in the code to do that. www.infotechtnt.com/talking-computers

    0
    mc_dude
    mc_dude

    10 years ago on Introduction

    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

    0
    mc_dude
    mc_dude

    Reply 10 years ago on Introduction

    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    =)

    0
    will421
    will421

    Reply 9 years ago on Introduction

    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?

    0
    will421
    will421

    Reply 8 years ago on Introduction

    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!

    0
    QwertyuioLP
    QwertyuioLP

    11 years ago on Introduction

    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

    0
    TATcreator
    TATcreator

    Reply 11 years ago on Introduction

    How is it supposed to work? We don't specialize in vbscripting, only batch.

    0
    SCRIPTmaster
    SCRIPTmaster

    Reply 11 years ago on Introduction

    what fo you mean? everything is mentioned in the tutorial! btw, batch is becomin gmore and more outdated, what you can do in batch can be done in vbscript! ;)

    0
    will421
    will421

    Reply 9 years ago on Introduction

    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.

    0
    QwertyuioLP
    QwertyuioLP

    Reply 11 years ago on Introduction

    All it does is speaks and then a pop up, pops up(bet u don't see that every day!)

    0
    will421
    will421

    8 years ago on Introduction

    I'm using this in a spelling test program for my teacher.
    :D

    0
    Super_Nerd
    Super_Nerd

    9 years ago on Introduction

    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

    0
    davidprosser
    davidprosser

    11 years ago on Introduction

    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"

    0
    davidprosser
    davidprosser

    Reply 11 years ago on Introduction

    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

    0
    Super_Nerd
    Super_Nerd

    9 years ago on Introduction

    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.

    TTS.png