Make Your Windows Computer Talk: The Perfect Sci-Fi Themed PC (Part 1, Weekend Feature)


Copy To Quick Launch_ll Hopefully you checked out our new Sci-fi themes for Windows 7 by now, because we’re now making our computer talk!

Introduction: What We’re Attempting To Do

There are some free tools that you can download online to make your computer talk, however we want to keep it as simple as possible, so you can easily modify it and realize your own ideas, that’s why I was looking for a handy VBS (Visual Basic) script file that would allow us to make the PC speak text stored in a .txt file. Then we can dynamically change that text file so we can make your Windows 7 PC behave a little like Jarvis and speak about current world events, weather and so on

First Step: A VBS script would give us the most flexibility. For example, you can now retrieve information from websites using a scraper or RSS feed and simply echo it into a .txt file. Then you could create a very simply script that will speak out current information like news headlines or important events on your favorite website. The possibilties are endless, especially for geeks who may have their own server.

Second Step: Next, once we have a working script, we should assign it to a shortcut

Third Step: In a third step we could use a Kinect gesture pack to run this script whenever we make a certain gesture. With all of that we could create a really cool talking computer that recognizes when we’re up and then give us important information. Obviously this requires a little work, but a talking computer can be really nice if you don’t mind the generic voices.

The Realization – Part 1

Alright, on Stackoverflow I found this handy snippet:


Set objFSO = CreateObject("Scripting.FileSystemObject")
strAFile = Wscript.Arguments(0)
Set objFile = objFSO.GetFile(strAFile)
If objFile.Size > 0 Then
Set objReadFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1)
strContents = objReadFile.ReadAll
objReadFile.Close
set ObjVoice=CreateObject("SAPI.SpVoice")
ObjVoice.Speak strContents
Else
Wscript.Echo "The file is empty."
End If

The script above can be called from a command prompt using a txt files as the first parameter. You may not know how to pass parameters via the command prompt, so we’ll quickly go through this. If you’re familiar with the Windows batch, skip this

1. Create a text file called speak.vbs – for example

New Text Document

2. When saving the file, MAKE SURE that you enter .vbs as the file extension AND select All Files from the dropdown

Select All Files For Vbs Speaking Script

3. Copy and paste the code snippet from above into the text file and hit CTRL + S to save the script

4. Alright, now create another text file (.txt file extension) and insert some random text like Today the world is going to end

5. Next, we’re going to test that everything works properly. Open a command prompt and cd into the directory where you stored the VBS script for example cd C:\snippets. You may have to change the drive letter to switch the drive. Simply enter C: or D: and hit enter to switch to another driver, then enter your “cd command”

Script To Start Speaking

6. If you followed all steps 1-5 correctly, you should now hear a voice speaking the text that is stored in your text file

7. If you don’t hear anything, double-check that your .vbs file has been created correctly and has the little VBS icon and the type should be “VBScript Script File”

Create Batch Script To Easily Make Your Computer Talk

1. Create a new text file and this time save the file as a .bat file (select All files from dropdown when saving)

2. If you saved it correctly it should have that little gear icon:

Runner Batch Script

3. Now enter exactly one line:

C:\snippets\speak.vbs mytextfile.txt

4. You may have to modify the path and name of your text file if you stored it somewhere else. If you run into problems, we suggest you follow our steps exactly

5. This is what the text file should look like:

Textfile

Easy Accessibility: Pin The “Computer Voice” To Your Taskbar

1. Create a QuickLaunch toolbar as described here
New Toolbar in Windows 7

2. Now you should have a dotted bar on the taskbar where you can drag and drop all sorts of files – including batch scripts

3. Drag the runner.bat onto the QuickLaunch bar

Copy To Quick Launch

4. You can now simply click the BIG icon on your newly created QuickLaunch toolbar and the computer will speak to you. That’s already pretty cool, but how about assigning a shortcut to it instead

Create Shortcut To Make The Computer Talk

1. Right-click on your runner.bat file and select Send to => Desktop

Send To Desktop To Speak

2. Go to your desktop or browse to C:\Users\username\Desktop
via the Windows Explorer.

Speaker Shortcut

3. Right-click on runner.bat and select Properties

4. Click into the field Shortcut key

Make The Computer Talk

5. Hold the keys you want to use for this script e.g. CTRL + ALT + A

6. Click Apply

7. Hit the keys on your keyboard to test the shortcut

Now your computer should talk to you and read the text file that you created.

Next On The List: Dynamic Voice And Kinect Gestures

In our 2nd tutorial we’re going to show you how you can dynamically change that text file to retrieve recent information via the internet and then let your computer speak them out loud to you whenever you hit a shortcut or in another step with a Kinect gesture

Final Words: Part 2 And Your Ideas

Got some cool ideas for the perfect Sci-Fi themed PC or want to show us what you’ve done with this guide? Send us a mail to support@windows7themes.net

Rate this article:
This article was rated 5 out of 5 stars
Based on 1 votes

Unable to save permission changes: access is denied
How to install WordPress locally in Windows 7
Remote Desktop Connections – Just How Secure Are They?

Juicy Logo White You love Windows, Gaming and everything digital? Great, we too! We have thousands of great Windows 7 themes, registry tweaks, tutorials, so please use our search box if you look for anything specific.

If you have some awesome desktop themes, tips or want to write for us, then drop us a mail!



Written by: Oliver Krautscheid (Nick: oliversk)
Oliver is the founder and lead editor of this site. He is interested in finding new ways to break Windows, find common e.... Full Bio

Contact The Author: Get Free Help.png

Connect:

facebook google twitter LinkedIn


Need help? Ask a question at our QA site, click the red button to get started:

7 Responses to Make Your Windows Computer Talk: The Perfect Sci-Fi Themed PC (Part 1, Weekend Feature)

  1. oliversk said:

    If any steps are not precise enough for you, please post a question and we’ll try to help

    If you’re new to VB scripts then it wouldn’t hurt to read some basics about it online, but programming knowledge is strictly not required for this tutorial. I think everyone can make their computer talk with this handy guide

  2. meena said:

    i was no successful in making my computer talk. my save file didnt have the option all files, so it went with word documents.is there here i went wrong. plz

  3. oliversk said:

    Meena you need to open it with the notepad editor and then there will be the option “All files”

  4. oliversk said:

    If that doesn’t work for you download notepad++ and it will work

  5. Brandon said:

    When will we be seeing part 2? And will it be useable without a kinect?

  6. Jiri said:

    Also waiting for 2nd part, would be awesome to talk to PC like in ironman, at least partly… :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>