This is an application that uses voice control to enact windows events.
Say the command and it will do something.
This is based on the sapi5.1 speech engine, which MS has been pushing into their OS's for a while.
Which is why it was packaged with WindowsXP.
The speech engine can do both speech to text and text to speech, so full 2 way auditory communication may be possible.
Perhaps a later version of this will include such capabilities.
Since MS has only been working on their speech engine for 8 years, it does not work most of the time.
The engine has the capability of working in 2 modes; Recognition and Command and Control.
Full Recognition blows. C&C is pretty damned good.
For this a limited grammar is loaded which the engine matches against.
After a little tuning the engine can perform flawlessly in c&c mode.
The grammar is defined in an xml file, here it is speech.xml.
This xml file also defines what script to execute when a recognition takes place.
You can modify the xml file all you want.
For each command, there is a .vbs that actually does stuff.
These are text files that you can edit/modify put some real code behind.
VBS is a suprisingly powerful scripting language MS intends for automation, and therefor gives it access to run and interact with applications and windows itself.
Here's how do to it yourself:
and download the sapi5.1 sdk.
Install this on your computer, this includes an activex control you can use to make your app voice aware.
Startup visual studio and create a new project.
Add a reference to the speech activex component the "Microsoft Speech Object Library"
here's the source code for an implementation in C#
This includes all code for the form, but the actual elements you require for your own app are quite small.
This one even plays a little sound when it recognizes a command, its the wav file of the star trek computer in next generation.
This requires an external xml file which denotes what commands to look for and what to do when you find it.
I take advantage of windows scripting host to make .vbs files for each function. The xml file is like this:
This contains the grammar the app will use, open it and take a look. See the disection portion below.
First we define the language, 409 means english
Next we create a rule. The rule must have a name, its not very important what name it has, just that it has one. The TOPLEVEL option specifies to always look for the rule. Rules can be created as “INACTIVE” which means they can only exist as sub-rules as part of a more complex TOPLEVEL rule.
<RULE NAME="command" TOPLEVEL="ACTIVE">
The first phrase segment I use as the computer name. So you can say "computer do this" or change it so it is "hal do this" you can change this, or take it out entirely.
Next we have another phrase segment. Inside this we have a list. The list tells the engine that this phrase segment will be dynamic. This means that any one of the phrase segments that are in the list may make up the total rule.
The phrase segments inside the list have a VALSTR attribute, this is used as what file to execute when the engine thinks it heard that entire sentance. So you can change what the commands do by; changing the script file directly or pointing it at a different script. You can change the commands themselves by changing the text in the phrase tags.
<PHRASE VALSTR="calc.vbs">start calculator</PHRASE>
The open tags must be closed, otherwise errors can occur.
Another phrase tag can be added here if you wish all commands to end in a specific word. I chose not to do this.
The rule is now complete, we will close it too.
We can add more rules here, if we want a completely different rule. The process above would be repeated. I chose not to do this.
Finally we close the grammar tag, which says we are done defining rules
Thats the whole file, any questions?
note: Capitalize letters you want to be spelled out in phrase segments, such as Email or IRC.
note: This application ships with .vbs files to actually carry out the commands, but any 'executable' will work. This includes compiled binaries (.exe and .com) as well as any properly registered script(.vbs .js .pl .php .py etc.) as well as any properly registered data file (.doc .asx .pdf etc.)
note: The rule will also only trigger if the specified file exists.