This sample demonstrates the capabilities of the Speech API (SAPI), which is included with Microsoft Windows XP Tablet PC Edition 2005. SAPI is a rich and similar enough to the handwriting recognition APIs that it can be easily learned by developers programming for Windows XP Tablet PC Edition 2005. For more information about handwriting recognition, see About Handwriting Recognition.
You must create an interop wrapper for the SAPI DLL. You can do this by adding a reference, clicking the COM tab, and then selecting Microsoft Speech Object Library. After you do this and the SpeechLib namespace is imported, developing for SAPI is similar to developing for handwriting recognition by using the Tablet PC Platform SDK. A recognizer is created (in this case, an in-process SpInProcRecognizer) and generates a context (of type SpInProcRecoContext) that is associated with the specific type of recognition. Events associated with the recognition process include the Hypothesis, Recognition, and EndStream events. A large number of Hypothesis events will be generated, although only one Recognition and EndStream event will be associated with a particular recognition attempt.
The sample provides a standard file dialog box to open a user-supplied .wav file. The sample application attempts to recognize the speech in this file, and the results are added to a RichTextEdit box. The technique for iterating over alternative possibilities is also shown, although that output is directed to the Debug console.
This sample requires that the following be installed: