At the forefront of Artificial Intelligence
  Home Articles Reviews Interviews JDK Glossary Features Discussion Search
Home » Articles » Speech Recognition » Applications/Code

SapiWizard: A SAPI-enabled AppWizard

I finally got fed up of copy-and-pasting code between SAPI applications and always setting up the XML settings, so I wrote this rather cool AppWizard that will set everything up for you. It is a standard MFC AppWizard with an additional step:

The AppWizard works with SDI and MDI by placing the SAPI code in the CMainFrame class and dialog projects by placing the SAPI code in the dialog class. Add SR Handler (checked by default) will add a SAPI event handler, message definition and call SetNotifyWindowMessage appropriately. "Enable TTS" adds the necessary text-to-speech code to your program and has the program say "Text-to-speech enabled" on startup.

The AppWizard sets up all the XML build commands and resources (called IDR_SAPI_RULES) and adds comments if asked to. The initial XML grammar top-level rule is called VID_MainRule and simply uses the word "Placeholder". If the speech handler is added, it will pop up a message box if this rule is triggered. Nothing fancy, but allows you to run the AppWizard, compile the program and test to see whether SAPI is working.

v1.10

Added support for microphone and user training. Any SAPI project now requires a Full Build to be performed when the project is first compiled. The project will tell you it can't compile if you try a normal build. This is just to get round a Visual Studio quirk.

Only handlers are created for the training, not buttons/menu items (this may be a future feature). Voice handlers are created, allowing the user to say "Display microphone/user training" (Display is optional). This is obviously all changeable within the XML.

Future Improvements

Here are some ideas I might implement in the future:
  • Additional XML grammar rules for basic commands (quitting, saving, opening, etc).
  • Allow advanced selection of SAPI events.
Any other ideas are welcome, just mail me!

Installation

Installation is simple. Just download the file at the bottom of this page and unzip it to:
C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template
Or the equivalent on your hard drive. Open up MSDev and select "New, Projects, SapiAppwizard" and you're on your way!

Last Updated: 26/06/2002

Article content copyright © James Matthews, 2002.
 Article Toolbar
Print
BibTeX entry

Search

Latest News
- Generation5 10-year Anniversary (03/09/2008)
- New Generation5 Design! (09/04/2007)
- Happy New Year 2007 (02/01/2007)
- Where has Generation5 Gone?! (04/11/2005)
- NeuroEvolving Robotic Operatives (NERO) (25/06/2005)

What's New?
- Back-propagation using the Generation5 JDK (07/04/2008)
- Hough Transforms (02/01/2008)
- Kohonen-based Image Analysis using the Generation5 JDK (11/12/2007)
- Modelling Bacterium using the JDK (19/03/2007)
- Modelling Bacterium using the JDK (19/03/2007)


All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -