Ai Forums Home Welcome Guest    Thursday, March 23, 2017
Ai Site > Ai Forums > Language Mind and Consciousness > An underdevoloped, but promising voice recognition ... Last PostsLoginRegisterWhy Register
Topic: An underdevoloped, but promising voice recognition setup.

lrh9
posted 8/18/2009  22:31Send e-mail to userReply with quote
I'd like to share a underdeveloped but promising voice recognition setup I encountered on the Internet. It only supports the Windows operating system, and even certain versions of Windows may have issues. Windows XP is recommended, but Windows 7 is only slightly less compatible and Windows Vista may have multiple issues.

It requires the installation of the scripting applet called AutoHotkey. Created by a guy named Chris. Many props to him.

http://www.autohotkey.com/download/AutoHotkeyInstall.exe

It requires the installation of the Windows Speech Software Development Kit. Windows sometimes rocks.

http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&displaylang=en

It requires the COM scripting library script. It was created by a guy named Sean. Not the coolest part of the program, but it's required. Download it and extract it to My Documents\AutoHotkey\Lib. (You'll have to create the last two folders.)

http://www.autohotkey.net/~Sean/Lib/COM.zip

And finally, it requires the script in the first post here.

http://www.autohotkey.com/forum/viewtopic.php?t=26841&postdays=0&postorder=asc&start=0

Simply copy the code into a new text file. There is a small alignment problem in the formatting. When you copy the script into your text editor, place the insertion point immediately after the first equals sign in the script, and hit delete and then save. Rename it "something".ahk. (You have to manually edit the extension if you don't save it this way. This requires the system to display recognized extensions. You can change this setting in the Folder View options.)

Now you have to edit the script to configure it to do what you want. You can right click and select the option edit script, and it will open in your default text editor. There are two important areas. The first area is under the comment add words (works with phrases as well) to be recognized here. You need to copy the line for each word or phrase you want and add it to that section, except where there is the word one, two, or three, you're going to put the words you want recognized. (They must be in quotes.)

Now, in order to get your recognized words to perform actions, you need to add code under the comment that says add custom operations here. The variable sText contains the word or phrase recognized, so if you want to do a specific action for a certain word or phrase you need to ensure that it is that word or phrase. Say I wanted Mozilla Firefox to run whenever I said "Firefox", and say I wanted Internet Explorer to run whenever I said "Internet Explorer". I'd add these lines:

If sText = Firefox
{
Run, %ProgramFiles%\Mozilla Firefox\firefox.exe
}
Else If sText = Internet Explorer
{
Run, %ProgramFiles%\Internet Explorer\iexplore.exe
}
Else
{
msgbox %sText%
}

Don't forget to add the words "Firefox" and "Internet Explorer" to the word base.

Then I save the changes, and double click the script to run it.

And sure enough, if I say Firefox, Firefox runs, and if I say Internet Explorer, Internet Explorer runs.

To exit the script, right click its icon in the tray and click Exit.

All of the actions are in the scripting language, so you will have to study it to create more commands, but I think it is worth it.

The script is great as it currently is, but I think there is some potential for improvement.

For starters, I'd like to add a method of adding words to the database without having to edit and reload the script. I think this can be accomplished by having database files that can be loaded on script start or changed while the script is running. I think it will be possible to add a command to the script to allow the user to command it to add a word, and then the user can type or say that word and it will be added.

Then of course there are actions. This will be slightly more tricky, but it should be possible for the script to create a script with actions in it associated to a new word and then run it when the word is called.

I also want to make it multi-threaded. As it stands if you have a message box displayed, the user has to manually acknowledge that box before other actions can take place. (Words aren't missed, actions are just paused.) I'd like for a user to be able to receive a message upon saying something and then acknowledge that message by saying "OK" or something.

I recommend changing speech recognition settings in the control panel so that the voice must match the text exactly - pronunciation sensitivity - (or be very close to it, something in the high range). If you don't, you'll have an easier time getting your voice recognized, but you'll have a ton of false positives. Applications starting up just while you breath.

Last edited by lrh9 @ 8/18/2009 10:48:00 PM
  1  
'Send Send email to user    Reply with quote Reply with quote    Edit message Edit message

Forums Home    The Artificial Intelligence Forum    Hal and other child machines    Alan and other chatbots  
Contact Us Terms of Use