Important: The information in this document is obsolete and should not be used for new development.
Speech Recognition CallBack Structure
When you receive a notification of recognition results through an application-defined callback routine (instead of using an Apple event handler), the Speech Recognition Manager sends your callback routine a pointer to a speech recognition callback structure, defined by theSRCallBackStructdata type.
- Note
- For information on writing a speech recognition callback routine, see "Speech Recognition Callback Routines" on page 1-85.
![]()
struct SRCallBackStruct { long what; long message; SRRecognizer instance; OSErr status; short flags; long refcon; }; typedef struct SRCallBackStruct SRCallBackStruct;
Field Description
what- A notification flag that indicates the kind of event that caused this notification to be issued. This field contains either
kSRNotifyRecognitionBeginningorkSRNotifyRecognitionDone. See "Notification Flags" on page 1-45 for complete details on the available notification flags.message- If the value of the
statusfield isnoErrand the value of thewhatfield iskSRNotifyRecognitionDone, this field contains a reference to a recognition result. Your callback routine can inspect the properties of this recognition result to determine what the user said.- IMPORTANT
- Note that your callback routine must release this reference (by calling
SRReleaseObject) when it is finished using it. If the value of thestatusfield is notnoErr, the value of this field is undefined.![]()
instance- A reference to the recognizer that issued this notification. You should not call
SRReleaseObjecton this recognizer reference in response to a recognition notification.status- An error code indicating the status of the recognition. If the value of this field is
noErr, themessagefield contains a reference to a recognition result. If the value of this field iskSRRecognitionDoneand the value of thewhatfield iskSRNotifyRecognitionDone, the recognizer finished without error but nothing belonging to that recognizer was recognized; in this case, themessagefield does not contain a reference to a recognition result. If the value of this field is any other value, some other error occurred.flags- Reserved for use by Apple Computer, Inc.
refcon- An application-defined reference constant. The value in this field is the value you passed in the
refconfield of a callback routine parameter structure (of typeSRCallBackParam).