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 theSRCallBackStruct
data 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
kSRNotifyRecognitionBeginning
orkSRNotifyRecognitionDone
. See "Notification Flags" on page 1-45 for complete details on the available notification flags.message
- If the value of the
status
field isnoErr
and the value of thewhat
field 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 thestatus
field is notnoErr
, the value of this field is undefined.![]()
instance
- A reference to the recognizer that issued this notification. You should not call
SRReleaseObject
on 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
, themessage
field contains a reference to a recognition result. If the value of this field iskSRRecognitionDone
and the value of thewhat
field iskSRNotifyRecognitionDone
, the recognizer finished without error but nothing belonging to that recognizer was recognized; in this case, themessage
field 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
refcon
field of a callback routine parameter structure (of typeSRCallBackParam
).