SpeechRecognition.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:29k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       SpeechRecognition.h
  3.  
  4.      Contains:   Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology: PlainTalk 1.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1992-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SPEECHRECOGNITION__
  18. #define __SPEECHRECOGNITION__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MIXEDMODE__
  23. #include "MixedMode.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. /* Error Codes [Speech recognition gets -5100 through -5199] */
  42. enum {
  43.     kSRNotAvailable             = -5100,                        /* the service requested is not avail or applicable */
  44.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  45.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  46.     kSROutOfMemory              = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  47.     kSRNotASpeechObject         = -5104,                        /* the object specified is no longer or never was valid */
  48.     kSRBadParameter             = -5105,                        /* an invalid parameter was specified */
  49.     kSRParamOutOfRange          = -5106,                        /* when we say 0-100, don't pass in 101. */
  50.     kSRBadSelector              = -5107,                        /* an unrecognized selector was specified */
  51.     kSRBufferTooSmall           = -5108,                        /* returned from attribute access functions */
  52.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  53.     kSRFeedbackNotAvail         = -5110,                        /* there is no feedback window associated with SRRecognizer */
  54.     kSRCantSetProperty          = -5111,                        /* a non-settable property was specified */
  55.     kSRCantGetProperty          = -5112,                        /* a non-gettable property was specified */
  56.     kSRCantSetDuringRecognition = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  57.     kSRAlreadyListening         = -5114,                        /* in response to SRStartListening */
  58.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  59.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  60.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  61.     kSRNoPendingUtterances      = -5118,                        /* nothing to continue search on */
  62.     kSRRecognitionCanceled      = -5119,                        /* an abort error occurred during search */
  63.     kSRRecognitionDone          = -5120,                        /* search has finished, but nothing was recognized */
  64.     kSROtherRecAlreadyModal     = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  65.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  66.     kSRSubItemNotFound          = -5123,                        /* returned when accessing a non-existent sub item of a container */
  67.     kSRLanguageModelTooBig      = -5124,                        /* Cant build language models so big */
  68.     kSRAlreadyReleased          = -5125,                        /* this object has already been released before */
  69.     kSRAlreadyFinished          = -5126,                        /* the language model can't be finished twice */
  70.     kSRWordNotFound             = -5127,                        /* the spelling couldn't be found in lookup(s) */
  71.     kSRNotFinishedWithRejection = -5128,                        /* property not found because the LMObj is not finished with rejection */
  72.     kSRExpansionTooDeep         = -5129,                        /* Language model is left recursive or is embedded too many levels */
  73.     kSRTooManyElements          = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  74.     kSRCantAdd                  = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)   */
  75.     kSRSndInSourceDisconnected  = -5132,                        /* Sound input source is disconnected */
  76.     kSRCantReadLanguageObject   = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  77.                                                                 /* non-release debugging error codes are included here */
  78.     kSRNotImplementedYet        = -5199                         /* you'd better wait for this feature in a future release */
  79. };
  80. /* Type Definitions */
  81. typedef struct OpaqueSRSpeechObject*    SRSpeechObject;
  82. typedef SRSpeechObject                  SRRecognitionSystem;
  83. typedef SRSpeechObject                  SRRecognizer;
  84. typedef SRSpeechObject                  SRSpeechSource;
  85. typedef SRSpeechSource                  SRRecognitionResult;
  86. typedef SRSpeechObject                  SRLanguageObject;
  87. typedef SRLanguageObject                SRLanguageModel;
  88. typedef SRLanguageObject                SRPath;
  89. typedef SRLanguageObject                SRPhrase;
  90. typedef SRLanguageObject                SRWord;
  91. /* between 0 and 100 */
  92. typedef unsigned short                  SRSpeedSetting;
  93. /* between 0 and 100 */
  94. typedef unsigned short                  SRRejectionLevel;
  95. /* When an event occurs, the user supplied proc will be called with a pointer   */
  96. /*  to the param passed in and a flag to indicate conditions such               */
  97. /*  as interrupt time or system background time.                                */
  98. struct SRCallBackStruct {
  99.     long                            what;                       /* one of notification flags */
  100.     long                            message;                    /* contains SRRecognitionResult id */
  101.     SRRecognizer                    instance;                   /* ID of recognizer being notified */
  102.     OSErr                           status;                     /* result status of last search */
  103.     short                           flags;                      /* non-zero if occurs during interrupt */
  104.     long                            refCon;                     /* user defined - set from SRCallBackParam */
  105. };
  106. typedef struct SRCallBackStruct         SRCallBackStruct;
  107. /* Call back procedure definition */
  108. typedef CALLBACK_API( void , SRCallBackProcPtr )(SRCallBackStruct *param);
  109. typedef STACK_UPP_TYPE(SRCallBackProcPtr)                       SRCallBackUPP;
  110. #if OPAQUE_UPP_TYPES
  111. #if CALL_NOT_IN_CARBON
  112.     EXTERN_API(SRCallBackUPP)
  113.     NewSRCallBackUPP               (SRCallBackProcPtr       userRoutine);
  114.     EXTERN_API(void)
  115.     DisposeSRCallBackUPP           (SRCallBackUPP           userUPP);
  116.     EXTERN_API(void)
  117.     InvokeSRCallBackUPP            (SRCallBackStruct *      param,
  118.                                     SRCallBackUPP           userUPP);
  119. #endif  /* CALL_NOT_IN_CARBON */
  120. #else
  121.     enum { uppSRCallBackProcInfo = 0x000000C0 };                    /* pascal no_return_value Func(4_bytes) */
  122.     #define NewSRCallBackUPP(userRoutine)                           (SRCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  123.     #define DisposeSRCallBackUPP(userUPP)                           DisposeRoutineDescriptor(userUPP)
  124.     #define InvokeSRCallBackUPP(param, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppSRCallBackProcInfo, (param))
  125. #endif
  126. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  127. #define NewSRCallBackProc(userRoutine)                          NewSRCallBackUPP(userRoutine)
  128. #define CallSRCallBackProc(userRoutine, param)                  InvokeSRCallBackUPP(param, userRoutine)
  129. struct SRCallBackParam {
  130.     SRCallBackUPP                   callBack;
  131.     long                            refCon;
  132. };
  133. typedef struct SRCallBackParam          SRCallBackParam;
  134. /* Recognition System Types */
  135. enum {
  136.     kSRDefaultRecognitionSystemID = 0
  137. };
  138. /* Recognition System Properties */
  139. enum {
  140.     kSRFeedbackAndListeningModes = FOUR_CHAR_CODE('fbwn'),      /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  141.     kSRRejectedWord             = FOUR_CHAR_CODE('rejq'),       /* the SRWord used to represent a rejection */
  142.     kSRCleanupOnClientExit      = FOUR_CHAR_CODE('clup')        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  143. };
  144. enum {
  145.     kSRNoFeedbackNoListenModes  = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes   */
  146.     kSRHasFeedbackHasListenModes = 1,                           /* next allocated recognizer has feedback window and uses listening modes          */
  147.     kSRNoFeedbackHasListenModes = 2                             /* next allocated recognizer has no feedback window but does use listening modes  */
  148. };
  149. /* Speech Source Types */
  150. enum {
  151.     kSRDefaultSpeechSource      = 0,
  152.     kSRLiveDesktopSpeechSource  = FOUR_CHAR_CODE('dklv'),       /* live desktop sound input */
  153.     kSRCanned22kHzSpeechSource  = FOUR_CHAR_CODE('ca22')        /* AIFF file based 16 bit, 22.050 KHz sound input */
  154. };
  155. /* Notification via Apple Event or Callback */
  156. /* Notification Flags */
  157. enum {
  158.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  159.     kSRNotifyRecognitionDone    = 1L << 1                       /* recognition has terminated. result (if any) is available. */
  160. };
  161. /* Apple Event selectors */
  162. /* AppleEvent message class  */
  163. enum {
  164.     kAESpeechSuite              = FOUR_CHAR_CODE('sprc')
  165. };
  166. /* AppleEvent message event ids */
  167. enum {
  168.     kAESpeechDone               = FOUR_CHAR_CODE('srsd'),
  169.     kAESpeechDetected           = FOUR_CHAR_CODE('srbd')
  170. };
  171. /* AppleEvent Parameter ids */
  172. enum {
  173.     keySRRecognizer             = FOUR_CHAR_CODE('krec'),
  174.     keySRSpeechResult           = FOUR_CHAR_CODE('kspr'),
  175.     keySRSpeechStatus           = FOUR_CHAR_CODE('ksst')
  176. };
  177. /* AppleEvent Parameter types */
  178. enum {
  179.     typeSRRecognizer            = FOUR_CHAR_CODE('trec'),
  180.     typeSRSpeechResult          = FOUR_CHAR_CODE('tspr')
  181. };
  182. /* SRRecognizer Properties */
  183. enum {
  184.     kSRNotificationParam        = FOUR_CHAR_CODE('noti'),       /* see notification flags below */
  185.     kSRCallBackParam            = FOUR_CHAR_CODE('call'),       /* type SRCallBackParam */
  186.     kSRSearchStatusParam        = FOUR_CHAR_CODE('stat'),       /* see status flags below */
  187.     kSRAutoFinishingParam       = FOUR_CHAR_CODE('afin'),       /* automatic finishing applied on LM for search */
  188.     kSRForegroundOnly           = FOUR_CHAR_CODE('fgon'),       /* Boolean. Default is true. If true, client recognizer only active when in foreground.   */
  189.     kSRBlockBackground          = FOUR_CHAR_CODE('blbg'),       /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  190.     kSRBlockModally             = FOUR_CHAR_CODE('blmd'),       /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  191.     kSRWantsResultTextDrawn     = FOUR_CHAR_CODE('txfb'),       /* Boolean. Default is true. If true, search results are posted to Feedback window */
  192.     kSRWantsAutoFBGestures      = FOUR_CHAR_CODE('dfbr'),       /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  193.     kSRSoundInVolume            = FOUR_CHAR_CODE('volu'),       /* short in [0..100] log scaled sound input power. Can't set this property */
  194.     kSRReadAudioFSSpec          = FOUR_CHAR_CODE('aurd'),       /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  195.     kSRCancelOnSoundOut         = FOUR_CHAR_CODE('caso'),       /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  196.     kSRSpeedVsAccuracyParam     = FOUR_CHAR_CODE('sped')        /* SRSpeedSetting between 0 and 100 */
  197. };
  198. /* 0 means more accurate but slower. */
  199. /* 100 means (much) less accurate but faster. */
  200. enum {
  201.     kSRUseToggleListen          = 0,                            /* listen key modes */
  202.     kSRUsePushToTalk            = 1
  203. };
  204. enum {
  205.     kSRListenKeyMode            = FOUR_CHAR_CODE('lkmd'),       /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  206.     kSRListenKeyCombo           = FOUR_CHAR_CODE('lkey'),       /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  207.     kSRListenKeyName            = FOUR_CHAR_CODE('lnam'),       /* Str63: string representing ListenKeyCombo */
  208.     kSRKeyWord                  = FOUR_CHAR_CODE('kwrd'),       /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  209.     kSRKeyExpected              = FOUR_CHAR_CODE('kexp')        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  210. };
  211. /* Operational Status Flags */
  212. enum {
  213.     kSRIdleRecognizer           = 1L << 0,                      /* engine is not active */
  214.     kSRSearchInProgress         = 1L << 1,                      /* search is in progress */
  215.     kSRSearchWaitForAllClients  = 1L << 2,                      /* search is suspended waiting on all clients' input */
  216.     kSRMustCancelSearch         = 1L << 3,                      /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  217.     kSRPendingSearch            = 1L << 4                       /* we're about to start searching */
  218. };
  219. /* Recognition Result Properties */
  220. enum {
  221.     kSRTEXTFormat               = FOUR_CHAR_CODE('TEXT'),       /* raw text in user supplied memory */
  222.     kSRPhraseFormat             = FOUR_CHAR_CODE('lmph'),       /* SRPhrase containing result words */
  223.     kSRPathFormat               = FOUR_CHAR_CODE('lmpt'),       /* SRPath containing result phrases or words */
  224.     kSRLanguageModelFormat      = FOUR_CHAR_CODE('lmfm')        /* top level SRLanguageModel for post parse */
  225. };
  226. /* SRLanguageObject Family Properties */
  227. enum {
  228.     kSRSpelling                 = FOUR_CHAR_CODE('spel'),       /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  229.     kSRLMObjType                = FOUR_CHAR_CODE('lmtp'),       /* Returns one of SRLanguageObject Types listed below */
  230.     kSRRefCon                   = FOUR_CHAR_CODE('refc'),       /* 4 bytes of user storage */
  231.     kSROptional                 = FOUR_CHAR_CODE('optl'),       /* Boolean -- true if SRLanguageObject is optional    */
  232.     kSREnabled                  = FOUR_CHAR_CODE('enbl'),       /* Boolean -- true if SRLanguageObject enabled */
  233.     kSRRepeatable               = FOUR_CHAR_CODE('rptb'),       /* Boolean -- true if SRLanguageObject is repeatable */
  234.     kSRRejectable               = FOUR_CHAR_CODE('rjbl'),       /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  235.                                                                 /*       object can be returned in place of SRLanguageObject with this property)   */
  236.     kSRRejectionLevel           = FOUR_CHAR_CODE('rjct')        /* SRRejectionLevel between 0 and 100 */
  237. };
  238. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  239. enum {
  240.     kSRLanguageModelType        = FOUR_CHAR_CODE('lmob'),       /* SRLanguageModel */
  241.     kSRPathType                 = FOUR_CHAR_CODE('path'),       /* SRPath */
  242.     kSRPhraseType               = FOUR_CHAR_CODE('phra'),       /* SRPhrase */
  243.     kSRWordType                 = FOUR_CHAR_CODE('word')        /* SRWord */
  244. };
  245. /* a normal and reasonable rejection level */
  246. enum {
  247.     kSRDefaultRejectionLevel    = 50
  248. };
  249. /********************************************************************************/
  250. /*                      NOTES ON USING THE API                                  */
  251. /*                                                                              */
  252. /*      All operations (with the exception of SRGetRecognitionSystem) are       */
  253. /*      directed toward an object allocated or begot from New, Get and Read     */
  254. /*      type calls.                                                             */
  255. /*                                                                              */
  256. /*      There is a simple rule in dealing with allocation and disposal:         */
  257. /*                                                                              */
  258. /*      *   all toolbox allocations are obtained from a SRRecognitionSystem     */
  259. /*                                                                              */
  260. /*      *   if you obtain an object via New or Get, then you own a reference    */
  261. /*          to that object and it must be released via SRReleaseObject when     */
  262. /*          you no longer need it                                               */
  263. /*                                                                              */
  264. /*      *   when you receive a SRRecognitionResult object via AppleEvent or     */
  265. /*          callback, it has essentially been created on your behalf and so     */
  266. /*          you are responsible for releasing it as above                       */
  267. /*                                                                              */
  268. /*      *   when you close a SRRecognitionSystem, all remaining objects which       */
  269. /*          were allocated with it will be forcefully released and any          */
  270. /*          remaining references to those objects will be invalid.              */
  271. /*                                                                              */
  272. /*      This translates into a very simple guideline:                           */
  273. /*          If you allocate it or have it allocated for you, you must release   */
  274. /*          it.  If you are only peeking at it, then don't release it.          */
  275. /*                                                                              */
  276. /********************************************************************************/
  277. /* Opening and Closing of the SRRecognitionSystem */
  278. EXTERN_API( OSErr )
  279. SROpenRecognitionSystem         (SRRecognitionSystem *  system,
  280.                                  OSType                 systemID)                           THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  281. EXTERN_API( OSErr )
  282. SRCloseRecognitionSystem        (SRRecognitionSystem    system)                             THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  283. /* Accessing Properties of any Speech Object */
  284. EXTERN_API( OSErr )
  285. SRSetProperty                   (SRSpeechObject         srObject,
  286.                                  OSType                 selector,
  287.                                  const void *           property,
  288.                                  Size                   propertyLen)                        THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  289. EXTERN_API( OSErr )
  290. SRGetProperty                   (SRSpeechObject         srObject,
  291.                                  OSType                 selector,
  292.                                  void *                 property,
  293.                                  Size *                 propertyLen)                        THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  294. /* Any object obtained via New or Get type calls must be released */
  295. EXTERN_API( OSErr )
  296. SRReleaseObject                 (SRSpeechObject         srObject)                           THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  297. EXTERN_API( OSErr )
  298. SRGetReference                  (SRSpeechObject         srObject,
  299.                                  SRSpeechObject *       newObjectRef)                       THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  300. /* SRRecognizer Instance Functions */
  301. EXTERN_API( OSErr )
  302. SRNewRecognizer                 (SRRecognitionSystem    system,
  303.                                  SRRecognizer *         recognizer,
  304.                                  OSType                 sourceID)                           THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  305. EXTERN_API( OSErr )
  306. SRStartListening                (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  307. EXTERN_API( OSErr )
  308. SRStopListening                 (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  309. EXTERN_API( OSErr )
  310. SRSetLanguageModel              (SRRecognizer           recognizer,
  311.                                  SRLanguageModel        languageModel)                      THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  312. EXTERN_API( OSErr )
  313. SRGetLanguageModel              (SRRecognizer           recognizer,
  314.                                  SRLanguageModel *      languageModel)                      THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  315. EXTERN_API( OSErr )
  316. SRContinueRecognition           (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  317. EXTERN_API( OSErr )
  318. SRCancelRecognition             (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  319. EXTERN_API( OSErr )
  320. SRIdle                          (void)                                                      THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  321. /* Language Model Building and Manipulation Functions */
  322. EXTERN_API( OSErr )
  323. SRNewLanguageModel              (SRRecognitionSystem    system,
  324.                                  SRLanguageModel *      model,
  325.                                  const void *           name,
  326.                                  Size                   nameLength)                         THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  327. EXTERN_API( OSErr )
  328. SRNewPath                       (SRRecognitionSystem    system,
  329.                                  SRPath *               path)                               THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  330. EXTERN_API( OSErr )
  331. SRNewPhrase                     (SRRecognitionSystem    system,
  332.                                  SRPhrase *             phrase,
  333.                                  const void *           text,
  334.                                  Size                   textLength)                         THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  335. EXTERN_API( OSErr )
  336. SRNewWord                       (SRRecognitionSystem    system,
  337.                                  SRWord *               word,
  338.                                  const void *           text,
  339.                                  Size                   textLength)                         THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  340. /* Operations on any object of the SRLanguageObject family */
  341. EXTERN_API( OSErr )
  342. SRPutLanguageObjectIntoHandle   (SRLanguageObject       languageObject,
  343.                                  Handle                 lobjHandle)                         THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  344. EXTERN_API( OSErr )
  345. SRPutLanguageObjectIntoDataFile (SRLanguageObject       languageObject,
  346.                                  short                  fRefNum)                            THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  347. EXTERN_API( OSErr )
  348. SRNewLanguageObjectFromHandle   (SRRecognitionSystem    system,
  349.                                  SRLanguageObject *     languageObject,
  350.                                  Handle                 lObjHandle)                         THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  351. EXTERN_API( OSErr )
  352. SRNewLanguageObjectFromDataFile (SRRecognitionSystem    system,
  353.                                  SRLanguageObject *     languageObject,
  354.                                  short                  fRefNum)                            THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  355. EXTERN_API( OSErr )
  356. SREmptyLanguageObject           (SRLanguageObject       languageObject)                     THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  357. EXTERN_API( OSErr )
  358. SRChangeLanguageObject          (SRLanguageObject       languageObject,
  359.                                  const void *           text,
  360.                                  Size                   textLength)                         THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  361. EXTERN_API( OSErr )
  362. SRAddLanguageObject             (SRLanguageObject       base,
  363.                                  SRLanguageObject       addon)                              THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  364. EXTERN_API( OSErr )
  365. SRAddText                       (SRLanguageObject       base,
  366.                                  const void *           text,
  367.                                  Size                   textLength,
  368.                                  long                   refCon)                             THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  369. EXTERN_API( OSErr )
  370. SRRemoveLanguageObject          (SRLanguageObject       base,
  371.                                  SRLanguageObject       toRemove)                           THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  372. /* Traversing SRRecognitionResults or SRLanguageObjects */
  373. EXTERN_API( OSErr )
  374. SRCountItems                    (SRSpeechObject         container,
  375.                                  long *                 count)                              THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  376. EXTERN_API( OSErr )
  377. SRGetIndexedItem                (SRSpeechObject         container,
  378.                                  SRSpeechObject *       item,
  379.                                  long                   index)                              THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  380. EXTERN_API( OSErr )
  381. SRSetIndexedItem                (SRSpeechObject         container,
  382.                                  SRSpeechObject         item,
  383.                                  long                   index)                              THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  384. EXTERN_API( OSErr )
  385. SRRemoveIndexedItem             (SRSpeechObject         container,
  386.                                  long                   index)                              THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  387. /* Utilizing the System Feedback Window */
  388. EXTERN_API( OSErr )
  389. SRDrawText                      (SRRecognizer           recognizer,
  390.                                  const void *           dispText,
  391.                                  Size                   dispLength)                         THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  392. EXTERN_API( OSErr )
  393. SRDrawRecognizedText            (SRRecognizer           recognizer,
  394.                                  const void *           dispText,
  395.                                  Size                   dispLength)                         THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  396. EXTERN_API( OSErr )
  397. SRSpeakText                     (SRRecognizer           recognizer,
  398.                                  const void *           speakText,
  399.                                  Size                   speakLength)                        THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  400. EXTERN_API( OSErr )
  401. SRSpeakAndDrawText              (SRRecognizer           recognizer,
  402.                                  const void *           text,
  403.                                  Size                   textLength)                         THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  404. EXTERN_API( OSErr )
  405. SRStopSpeech                    (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  406. EXTERN_API( Boolean )
  407. SRSpeechBusy                    (SRRecognizer           recognizer)                         THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  408. EXTERN_API( OSErr )
  409. SRProcessBegin                  (SRRecognizer           recognizer,
  410.                                  Boolean                failed)                             THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  411. EXTERN_API( OSErr )
  412. SRProcessEnd                    (SRRecognizer           recognizer,
  413.                                  Boolean                failed)                             THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  414. #if PRAGMA_STRUCT_ALIGN
  415.     #pragma options align=reset
  416. #elif PRAGMA_STRUCT_PACKPUSH
  417.     #pragma pack(pop)
  418. #elif PRAGMA_STRUCT_PACK
  419.     #pragma pack()
  420. #endif
  421. #ifdef PRAGMA_IMPORT_OFF
  422. #pragma import off
  423. #elif PRAGMA_IMPORT
  424. #pragma import reset
  425. #endif
  426. #ifdef __cplusplus
  427. }
  428. #endif
  429. #endif /* __SPEECHRECOGNITION__ */