Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Speech Recognition Manager /
Chapter 1 - Speech Recognition Manager / Using the Speech Recognition Manager


Checking for Speech Recognition Capabilities

Before calling any speech recognition routines, you need to verify that the Speech Recognition Manager is available in the current operating environment and that it has the capabilities you need. You can verify that the Speech Recognition Manager is available by calling the Gestalt function with the gestaltSpeechRecognitionVersion selector. Gestalt returns a long word whose value indicates the version of the Speech Recognition Manager.

IMPORTANT
You should ensure that the value returned in the response parameter is greater than or equal to 0x0150 before using the programming interfaces described in this chapter.
Listing 1-2 illustrates how to determine whether the Speech Recognition Manager is available.

Listing 1-2 Checking for the availability of the Speech Recognition Manager

Boolean MyHasSpeechRecognitionMgr (void)
{
   OSErr       myErr;
   long        mySRVersion;
   Boolean     myHasSRMgr = FALSE;
   
   myErr = Gestalt (gestaltSpeechRecognitionVersion, &mySRVersion);
   if (!myErr)
      if (mySRVersion >= 0x0150)
         myHasSRMgr = TRUE;

   return myHasSRMgr;
}
Note
For more information on the Gestalt function, see Inside Macintosh: Operating System Utilities.
The Speech Recognition Manager also defines a speech attributes selector for Gestalt. You can use this selector to get information about the available speech sources. See "Gestalt Selectors and Response Values" on page 1-36 for complete details.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
22 JAN 1997