Important: The information in this document is obsolete and should not be used for new development.
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 theGestalt
function with thegestaltSpeechRecognitionVersion
selector.Gestalt
returns a long word whose value indicates the version of the Speech Recognition Manager.
Listing 1-2 illustrates how to determine whether the Speech Recognition Manager is available.
- 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 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; }The Speech Recognition Manager also defines a speech attributes selector for
- Note
- For more information on the
Gestalt
function, see Inside Macintosh: Operating System Utilities.![]()
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.