SpeechRecognition.pas 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. {
  2. File: SpeechRecognition/SpeechRecognition.h
  3. Contains: Apple Speech Recognition Toolbox Interfaces.
  4. Version: SpeechRecognition-4.1.5~11
  5. Copyright: © 1992-2008 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit SpeechRecognition;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined iphonesim}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined iphonesim}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. {$ifc defined ios}
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_OS_EMBEDDED := TRUE}
  153. {$elsec}
  154. {$setc TARGET_OS_MAC := TRUE}
  155. {$setc TARGET_OS_IPHONE := FALSE}
  156. {$setc TARGET_OS_EMBEDDED := FALSE}
  157. {$endc}
  158. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  159. {$elsec}
  160. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  161. {$endc}
  162. {$ifc defined __LP64__ and __LP64__ }
  163. {$setc TARGET_CPU_64 := TRUE}
  164. {$elsec}
  165. {$setc TARGET_CPU_64 := FALSE}
  166. {$endc}
  167. {$ifc defined FPC_BIG_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  170. {$elifc defined FPC_LITTLE_ENDIAN}
  171. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  172. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  173. {$elsec}
  174. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  175. {$endc}
  176. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  177. {$setc CALL_NOT_IN_CARBON := FALSE}
  178. {$setc OLDROUTINENAMES := FALSE}
  179. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  180. {$setc OPAQUE_UPP_TYPES := TRUE}
  181. {$setc OTCARBONAPPLICATION := TRUE}
  182. {$setc OTKERNEL := FALSE}
  183. {$setc PM_USE_SESSION_APIS := TRUE}
  184. {$setc TARGET_API_MAC_CARBON := TRUE}
  185. {$setc TARGET_API_MAC_OS8 := FALSE}
  186. {$setc TARGET_API_MAC_OSX := TRUE}
  187. {$setc TARGET_CARBON := TRUE}
  188. {$setc TARGET_CPU_68K := FALSE}
  189. {$setc TARGET_CPU_MIPS := FALSE}
  190. {$setc TARGET_CPU_SPARC := FALSE}
  191. {$setc TARGET_OS_UNIX := FALSE}
  192. {$setc TARGET_OS_WIN32 := FALSE}
  193. {$setc TARGET_RT_MAC_68881 := FALSE}
  194. {$setc TARGET_RT_MAC_CFM := FALSE}
  195. {$setc TARGET_RT_MAC_MACHO := TRUE}
  196. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  197. {$setc TYPE_BOOL := FALSE}
  198. {$setc TYPE_EXTENDED := FALSE}
  199. {$setc TYPE_LONGLONG := TRUE}
  200. uses MacTypes,Files,AEDataModel;
  201. {$endc} {not MACOSALLINCLUDE}
  202. {$ifc TARGET_OS_MAC}
  203. {$ALIGN MAC68K}
  204. { Error Codes [Speech recognition gets -5100 through -5199] }
  205. const
  206. kSRNotAvailable = -5100; { the service requested is not avail or applicable }
  207. kSRInternalError = -5101; { a system internal or hardware error condition }
  208. kSRComponentNotFound = -5102; { a needed system resource was not located }
  209. kSROutOfMemory = -5103; { an out of memory error occurred in the toolbox memory space }
  210. kSRNotASpeechObject = -5104; { the object specified is no longer or never was valid }
  211. kSRBadParameter = -5105; { an invalid parameter was specified }
  212. kSRParamOutOfRange = -5106; { when we say 0-100, don't pass in 101. }
  213. kSRBadSelector = -5107; { an unrecognized selector was specified }
  214. kSRBufferTooSmall = -5108; { returned from attribute access functions }
  215. kSRNotARecSystem = -5109; { the object used was not a SRRecognitionSystem }
  216. kSRFeedbackNotAvail = -5110; { there is no feedback window associated with SRRecognizer }
  217. kSRCantSetProperty = -5111; { a non-settable property was specified }
  218. kSRCantGetProperty = -5112; { a non-gettable property was specified }
  219. kSRCantSetDuringRecognition = -5113; { the property can't be set while recognition is in progress -- do before or between utterances. }
  220. kSRAlreadyListening = -5114; { in response to SRStartListening }
  221. kSRNotListeningState = -5115; { in response to SRStopListening }
  222. kSRModelMismatch = -5116; { no acoustical models are avail to match request }
  223. kSRNoClientLanguageModel = -5117; { trying to access a non-specified SRLanguageModel }
  224. kSRNoPendingUtterances = -5118; { nothing to continue search on }
  225. kSRRecognitionCanceled = -5119; { an abort error occurred during search }
  226. kSRRecognitionDone = -5120; { search has finished, but nothing was recognized }
  227. kSROtherRecAlreadyModal = -5121; { another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now }
  228. kSRHasNoSubItems = -5122; { SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. }
  229. kSRSubItemNotFound = -5123; { returned when accessing a non-existent sub item of a container }
  230. kSRLanguageModelTooBig = -5124; { Cant build language models so big }
  231. kSRAlreadyReleased = -5125; { this object has already been released before }
  232. kSRAlreadyFinished = -5126; { the language model can't be finished twice }
  233. kSRWordNotFound = -5127; { the spelling couldn't be found in lookup(s) }
  234. kSRNotFinishedWithRejection = -5128; { property not found because the LMObj is not finished with rejection }
  235. kSRExpansionTooDeep = -5129; { Language model is left recursive or is embedded too many levels }
  236. kSRTooManyElements = -5130; { Too many elements added to phrase or path or other langauge model object }
  237. kSRCantAdd = -5131; { Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject) }
  238. kSRSndInSourceDisconnected = -5132; { Sound input source is disconnected }
  239. kSRCantReadLanguageObject = -5133; { An error while trying to create new Language object from file or pointer -- possibly bad format }
  240. { non-release debugging error codes are included here }
  241. kSRNotImplementedYet = -5199; { you'd better wait for this feature in a future release }
  242. { Type Definitions }
  243. type
  244. SRSpeechObject = ^OpaqueSRSpeechObject; { an opaque type }
  245. OpaqueSRSpeechObject = record end;
  246. SRSpeechObjectPtr = ^SRSpeechObject; { when a var xx:SRSpeechObject parameter can be nil, it is changed to xx: SRSpeechObjectPtr }
  247. SRRecognitionSystem = SRSpeechObject;
  248. SRRecognizer = SRSpeechObject;
  249. SRSpeechSource = SRSpeechObject;
  250. SRRecognitionResult = SRSpeechSource;
  251. SRLanguageObject = SRSpeechObject;
  252. SRLanguageModel = SRLanguageObject;
  253. SRPath = SRLanguageObject;
  254. SRPhrase = SRLanguageObject;
  255. SRWord = SRLanguageObject;
  256. { between 0 and 100 }
  257. type
  258. SRSpeedSetting = UInt16;
  259. { between 0 and 100 }
  260. type
  261. SRRejectionLevel = UInt16;
  262. { When an event occurs, the user supplied proc will be called with a pointer }
  263. { to the param passed in and a flag to indicate conditions such }
  264. { as interrupt time or system background time. }
  265. type
  266. SRCallBackStructPtr = ^SRCallBackStruct;
  267. SRCallBackStruct = record
  268. what: UInt32; { one of notification flags }
  269. message: SIGNEDLONG; { contains SRRecognitionResult id (32 / 64 bits) }
  270. instance: SRRecognizer; { ID of recognizer being notified }
  271. status: OSErr; { result status of last search }
  272. flags: SInt16; { non-zero if occurs during interrupt }
  273. refCon: SRefCon; { user defined - set from SRCallBackParam }
  274. end;
  275. { Call back procedure definition }
  276. type
  277. SRCallBackProcPtr = procedure( var param: SRCallBackStruct );
  278. SRCallBackUPP = SRCallBackProcPtr;
  279. {
  280. * NewSRCallBackUPP()
  281. *
  282. * Availability:
  283. * Mac OS X: in version 10.0 and later in Carbon.framework
  284. * CarbonLib: in CarbonLib 1.0.2 and later
  285. * Non-Carbon CFM: available as macro/inline
  286. }
  287. function NewSRCallBackUPP( userRoutine: SRCallBackProcPtr ): SRCallBackUPP; external name '_NewSRCallBackUPP';
  288. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  289. {
  290. * DisposeSRCallBackUPP()
  291. *
  292. * Availability:
  293. * Mac OS X: in version 10.0 and later in Carbon.framework
  294. * CarbonLib: in CarbonLib 1.0.2 and later
  295. * Non-Carbon CFM: available as macro/inline
  296. }
  297. procedure DisposeSRCallBackUPP( userUPP: SRCallBackUPP ); external name '_DisposeSRCallBackUPP';
  298. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  299. {
  300. * InvokeSRCallBackUPP()
  301. *
  302. * Availability:
  303. * Mac OS X: in version 10.0 and later in Carbon.framework
  304. * CarbonLib: in CarbonLib 1.0.2 and later
  305. * Non-Carbon CFM: available as macro/inline
  306. }
  307. procedure InvokeSRCallBackUPP( var param: SRCallBackStruct; userUPP: SRCallBackUPP ); external name '_InvokeSRCallBackUPP';
  308. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  309. type
  310. SRCallBackParamPtr = ^SRCallBackParam;
  311. SRCallBackParam = record
  312. callBack: SRCallBackUPP;
  313. refCon: SRefCon;
  314. end;
  315. { Recognition System Types }
  316. const
  317. kSRDefaultRecognitionSystemID = 0;
  318. { Recognition System Properties }
  319. const
  320. kSRFeedbackAndListeningModes = FourCharCode('fbwn'); { short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes }
  321. kSRRejectedWord = FourCharCode('rejq'); { the SRWord used to represent a rejection }
  322. kSRCleanupOnClientExit = FourCharCode('clup'); { Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits }
  323. const
  324. kSRNoFeedbackNoListenModes = 0; { next allocated recognizer has no feedback window and doesn't use listening modes }
  325. kSRHasFeedbackHasListenModes = 1; { next allocated recognizer has feedback window and uses listening modes }
  326. kSRNoFeedbackHasListenModes = 2; { next allocated recognizer has no feedback window but does use listening modes }
  327. { Speech Source Types }
  328. const
  329. kSRDefaultSpeechSource = 0;
  330. kSRLiveDesktopSpeechSource = FourCharCode('dklv'); { live desktop sound input }
  331. kSRCanned22kHzSpeechSource = FourCharCode('ca22'); { AIFF file based 16 bit, 22.050 KHz sound input }
  332. { Notification via Apple Event or Callback }
  333. { Notification Flags }
  334. const
  335. kSRNotifyRecognitionBeginning = 1 shl 0; { recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition }
  336. kSRNotifyRecognitionDone = 1 shl 1; { recognition has terminated. result (if any) is available. }
  337. { Apple Event selectors }
  338. { AppleEvent message class }
  339. const
  340. kAESpeechSuite = FourCharCode('sprc');
  341. { AppleEvent message event ids }
  342. const
  343. kAESpeechDone = FourCharCode('srsd');
  344. kAESpeechDetected = FourCharCode('srbd');
  345. { AppleEvent Parameter ids }
  346. const
  347. keySRRecognizer = FourCharCode('krec');
  348. keySRSpeechResult = FourCharCode('kspr');
  349. keySRSpeechStatus = FourCharCode('ksst');
  350. { AppleEvent Parameter types }
  351. const
  352. typeSRRecognizer = FourCharCode('trec');
  353. typeSRSpeechResult = FourCharCode('tspr');
  354. { SRRecognizer Properties }
  355. const
  356. kSRNotificationParam = FourCharCode('noti'); { SInt32: See notification flags below }
  357. kSRCallBackParam = FourCharCode('call'); { type SRCallBackParam }
  358. kSRSearchStatusParam = FourCharCode('stat'); { SInt32: see status flags below }
  359. kSRAutoFinishingParam = FourCharCode('afin'); { SInt32: Automatic finishing applied on LM for search }
  360. kSRForegroundOnly = FourCharCode('fgon'); { Boolean: Default is true. If true, client recognizer only active when in foreground. }
  361. kSRBlockBackground = FourCharCode('blbg'); { Boolean: Default is false. If true, when client recognizer in foreground, rest of LMs are inactive. }
  362. kSRBlockModally = FourCharCode('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! }
  363. kSRWantsResultTextDrawn = FourCharCode('txfb'); { Boolean: Default is true. If true, search results are posted to Feedback window }
  364. kSRWantsAutoFBGestures = FourCharCode('dfbr'); { Boolean: Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior }
  365. kSRSoundInVolume = FourCharCode('volu'); { short in [0..100] log scaled sound input power. Can't set this property }
  366. kSRReadAudioFSSpec = FourCharCode('aurd'); { *FSSpec: Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF }
  367. kSRReadAudioURL = FourCharCode('aurl'); { CFURLRef: Specify CFURLRef where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF }
  368. kSRCancelOnSoundOut = FourCharCode('caso'); { Boolean: Default is true. If any sound is played out during utterance, recognition is aborted. }
  369. kSRSpeedVsAccuracyParam = FourCharCode('sped'); { SRSpeedSetting between 0 and 100 }
  370. { 0 means more accurate but slower. }
  371. { 100 means (much) less accurate but faster. }
  372. const
  373. kSRUseToggleListen = 0; { listen key modes }
  374. kSRUsePushToTalk = 1;
  375. const
  376. kSRListenKeyMode = FourCharCode('lkmd'); { short: either kSRUseToggleListen or kSRUsePushToTalk }
  377. kSRListenKeyCombo = FourCharCode('lkey'); { short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message }
  378. kSRListenKeyName = FourCharCode('lnam'); { Str63: string representing ListenKeyCombo }
  379. kSRKeyWord = FourCharCode('kwrd'); { Str255: keyword preceding spoken commands in kSRUseToggleListen mode }
  380. kSRKeyExpected = FourCharCode('kexp'); { Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? }
  381. { Operational Status Flags }
  382. const
  383. kSRIdleRecognizer = 1 shl 0; { engine is not active }
  384. kSRSearchInProgress = 1 shl 1; { search is in progress }
  385. kSRSearchWaitForAllClients = 1 shl 2; { search is suspended waiting on all clients' input }
  386. kSRMustCancelSearch = 1 shl 3; { something has occurred (sound played, non-speech detected) requiring the search to abort }
  387. kSRPendingSearch = 1 shl 4; { we're about to start searching }
  388. { Recognition Result Properties }
  389. const
  390. kSRTEXTFormat = FourCharCode('TEXT'); { raw text in user supplied memory }
  391. kSRPhraseFormat = FourCharCode('lmph'); { SRPhrase containing result words }
  392. kSRPathFormat = FourCharCode('lmpt'); { SRPath containing result phrases or words }
  393. kSRLanguageModelFormat = FourCharCode('lmfm'); { top level SRLanguageModel for post parse }
  394. { SRLanguageObject Family Properties }
  395. const
  396. kSRSpelling = FourCharCode('spel'); { spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel }
  397. kSRLMObjType = FourCharCode('lmtp'); { Returns one of SRLanguageObject Types listed below }
  398. kSRRefCon = FourCharCode('refc'); { long (4/8 bytes) for user storage }
  399. kSROptional = FourCharCode('optl'); { Boolean -- true if SRLanguageObject is optional }
  400. kSREnabled = FourCharCode('enbl'); { Boolean -- true if SRLanguageObject enabled }
  401. kSRRepeatable = FourCharCode('rptb'); { Boolean -- true if SRLanguageObject is repeatable }
  402. kSRRejectable = FourCharCode('rjbl'); { Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord }
  403. { object can be returned in place of SRLanguageObject with this property) }
  404. kSRRejectionLevel = FourCharCode('rjct'); { SRRejectionLevel between 0 and 100 }
  405. { LM Object Types -- returned as kSRLMObjType property of language model objects }
  406. const
  407. kSRLanguageModelType = FourCharCode('lmob'); { SRLanguageModel }
  408. kSRPathType = FourCharCode('path'); { SRPath }
  409. kSRPhraseType = FourCharCode('phra'); { SRPhrase }
  410. kSRWordType = FourCharCode('word'); { SRWord }
  411. { a normal and reasonable rejection level }
  412. const
  413. kSRDefaultRejectionLevel = 50;
  414. {******************************************************************************}
  415. { NOTES ON USING THE API }
  416. { All operations (with the exception of SRGetRecognitionSystem) are }
  417. { directed toward an object allocated or begot from New, Get and Read }
  418. { type calls. }
  419. { There is a simple rule in dealing with allocation and disposal: }
  420. { * all toolbox allocations are obtained from a SRRecognitionSystem }
  421. { * if you obtain an object via New or Get, then you own a reference }
  422. { to that object and it must be released via SRReleaseObject when }
  423. { you no longer need it }
  424. { * when you receive a SRRecognitionResult object via AppleEvent or }
  425. { callback, it has essentially been created on your behalf and so }
  426. { you are responsible for releasing it as above }
  427. { * when you close a SRRecognitionSystem, all remaining objects which }
  428. { were allocated with it will be forcefully released and any }
  429. { remaining references to those objects will be invalid. }
  430. { This translates into a very simple guideline: }
  431. { If you allocate it or have it allocated for you, you must release }
  432. { it. If you are only peeking at it, then don't release it. }
  433. {******************************************************************************}
  434. { Opening and Closing of the SRRecognitionSystem }
  435. {
  436. * SROpenRecognitionSystem()
  437. *
  438. * Availability:
  439. * Mac OS X: in version 10.0 and later in Carbon.framework
  440. * CarbonLib: in CarbonLib 1.0 and later
  441. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  442. }
  443. function SROpenRecognitionSystem( var system: SRRecognitionSystem; systemID: OSType ): OSErr; external name '_SROpenRecognitionSystem';
  444. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  445. {
  446. * SRCloseRecognitionSystem()
  447. *
  448. * Availability:
  449. * Mac OS X: in version 10.0 and later in Carbon.framework
  450. * CarbonLib: in CarbonLib 1.0 and later
  451. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  452. }
  453. function SRCloseRecognitionSystem( system: SRRecognitionSystem ): OSErr; external name '_SRCloseRecognitionSystem';
  454. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  455. { Accessing Properties of any Speech Object }
  456. {
  457. * SRSetProperty()
  458. *
  459. * Availability:
  460. * Mac OS X: in version 10.0 and later in Carbon.framework
  461. * CarbonLib: in CarbonLib 1.0 and later
  462. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  463. }
  464. function SRSetProperty( srObject: SRSpeechObject; selector: OSType; proprty: {const} UnivPtr; propertyLen: Size ): OSErr; external name '_SRSetProperty';
  465. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  466. {
  467. * SRGetProperty()
  468. *
  469. * Availability:
  470. * Mac OS X: in version 10.0 and later in Carbon.framework
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  473. }
  474. function SRGetProperty( srObject: SRSpeechObject; selector: OSType; proprty: UnivPtr; var propertyLen: Size ): OSErr; external name '_SRGetProperty';
  475. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  476. { Any object obtained via New or Get type calls must be released }
  477. {
  478. * SRReleaseObject()
  479. *
  480. * Availability:
  481. * Mac OS X: in version 10.0 and later in Carbon.framework
  482. * CarbonLib: in CarbonLib 1.0 and later
  483. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  484. }
  485. function SRReleaseObject( srObject: SRSpeechObject ): OSErr; external name '_SRReleaseObject';
  486. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  487. {
  488. * SRGetReference()
  489. *
  490. * Availability:
  491. * Mac OS X: in version 10.0 and later in Carbon.framework
  492. * CarbonLib: in CarbonLib 1.0 and later
  493. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  494. }
  495. function SRGetReference( srObject: SRSpeechObject; var newObjectRef: SRSpeechObject ): OSErr; external name '_SRGetReference';
  496. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  497. { SRRecognizer Instance Functions }
  498. {
  499. * SRNewRecognizer()
  500. *
  501. * Availability:
  502. * Mac OS X: in version 10.0 and later in Carbon.framework
  503. * CarbonLib: in CarbonLib 1.0 and later
  504. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  505. }
  506. function SRNewRecognizer( system: SRRecognitionSystem; var recognizer: SRRecognizer; sourceID: OSType ): OSErr; external name '_SRNewRecognizer';
  507. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  508. {
  509. * SRStartListening()
  510. *
  511. * Availability:
  512. * Mac OS X: in version 10.0 and later in Carbon.framework
  513. * CarbonLib: in CarbonLib 1.0 and later
  514. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  515. }
  516. function SRStartListening( recognizer: SRRecognizer ): OSErr; external name '_SRStartListening';
  517. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  518. {
  519. * SRStopListening()
  520. *
  521. * Availability:
  522. * Mac OS X: in version 10.0 and later in Carbon.framework
  523. * CarbonLib: in CarbonLib 1.0 and later
  524. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  525. }
  526. function SRStopListening( recognizer: SRRecognizer ): OSErr; external name '_SRStopListening';
  527. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  528. {
  529. * SRSetLanguageModel()
  530. *
  531. * Availability:
  532. * Mac OS X: in version 10.0 and later in Carbon.framework
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  535. }
  536. function SRSetLanguageModel( recognizer: SRRecognizer; languageModel: SRLanguageModel ): OSErr; external name '_SRSetLanguageModel';
  537. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  538. {
  539. * SRGetLanguageModel()
  540. *
  541. * Availability:
  542. * Mac OS X: in version 10.0 and later in Carbon.framework
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  545. }
  546. function SRGetLanguageModel( recognizer: SRRecognizer; var languageModel: SRLanguageModel ): OSErr; external name '_SRGetLanguageModel';
  547. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  548. {
  549. * SRContinueRecognition()
  550. *
  551. * Availability:
  552. * Mac OS X: in version 10.0 and later in Carbon.framework
  553. * CarbonLib: in CarbonLib 1.0 and later
  554. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  555. }
  556. function SRContinueRecognition( recognizer: SRRecognizer ): OSErr; external name '_SRContinueRecognition';
  557. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  558. {
  559. * SRCancelRecognition()
  560. *
  561. * Availability:
  562. * Mac OS X: in version 10.0 and later in Carbon.framework
  563. * CarbonLib: in CarbonLib 1.0 and later
  564. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  565. }
  566. function SRCancelRecognition( recognizer: SRRecognizer ): OSErr; external name '_SRCancelRecognition';
  567. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  568. {
  569. * SRIdle()
  570. *
  571. * Availability:
  572. * Mac OS X: in version 10.0 and later in Carbon.framework
  573. * CarbonLib: in CarbonLib 1.0 and later
  574. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  575. }
  576. function SRIdle: OSErr; external name '_SRIdle';
  577. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  578. { Language Model Building and Manipulation Functions }
  579. {
  580. * SRNewLanguageModel()
  581. *
  582. * Availability:
  583. * Mac OS X: in version 10.0 and later in Carbon.framework
  584. * CarbonLib: in CarbonLib 1.0 and later
  585. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  586. }
  587. function SRNewLanguageModel( system: SRRecognitionSystem; var model: SRLanguageModel; name: {const} UnivPtr; nameLength: SInt32 ): OSErr; external name '_SRNewLanguageModel';
  588. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  589. {
  590. * SRNewPath()
  591. *
  592. * Availability:
  593. * Mac OS X: in version 10.0 and later in Carbon.framework
  594. * CarbonLib: in CarbonLib 1.0 and later
  595. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  596. }
  597. function SRNewPath( system: SRRecognitionSystem; var path: SRPath ): OSErr; external name '_SRNewPath';
  598. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  599. {
  600. * SRNewPhrase()
  601. *
  602. * Availability:
  603. * Mac OS X: in version 10.0 and later in Carbon.framework
  604. * CarbonLib: in CarbonLib 1.0 and later
  605. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  606. }
  607. function SRNewPhrase( system: SRRecognitionSystem; var phrase: SRPhrase; text: {const} UnivPtr; textLength: SInt32 ): OSErr; external name '_SRNewPhrase';
  608. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  609. {
  610. * SRNewWord()
  611. *
  612. * Availability:
  613. * Mac OS X: in version 10.0 and later in Carbon.framework
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  616. }
  617. function SRNewWord( system: SRRecognitionSystem; var word: SRWord; text: {const} UnivPtr; textLength: SInt32 ): OSErr; external name '_SRNewWord';
  618. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  619. { Operations on any object of the SRLanguageObject family }
  620. {
  621. * SRPutLanguageObjectIntoHandle()
  622. *
  623. * Availability:
  624. * Mac OS X: in version 10.0 and later in Carbon.framework
  625. * CarbonLib: in CarbonLib 1.0 and later
  626. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  627. }
  628. function SRPutLanguageObjectIntoHandle( languageObject: SRLanguageObject; lobjHandle: Handle ): OSErr; external name '_SRPutLanguageObjectIntoHandle';
  629. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  630. {
  631. * SRPutLanguageObjectIntoDataFile()
  632. *
  633. * Availability:
  634. * Mac OS X: in version 10.0 and later in Carbon.framework
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  637. }
  638. function SRPutLanguageObjectIntoDataFile( languageObject: SRLanguageObject; fRefNum: SInt16 ): OSErr; external name '_SRPutLanguageObjectIntoDataFile';
  639. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  640. {
  641. * SRNewLanguageObjectFromHandle()
  642. *
  643. * Availability:
  644. * Mac OS X: in version 10.0 and later in Carbon.framework
  645. * CarbonLib: in CarbonLib 1.0 and later
  646. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  647. }
  648. function SRNewLanguageObjectFromHandle( system: SRRecognitionSystem; var languageObject: SRLanguageObject; lObjHandle: Handle ): OSErr; external name '_SRNewLanguageObjectFromHandle';
  649. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  650. {
  651. * SRNewLanguageObjectFromDataFile()
  652. *
  653. * Availability:
  654. * Mac OS X: in version 10.0 and later in Carbon.framework
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  657. }
  658. function SRNewLanguageObjectFromDataFile( system: SRRecognitionSystem; var languageObject: SRLanguageObject; fRefNum: SInt16 ): OSErr; external name '_SRNewLanguageObjectFromDataFile';
  659. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  660. {
  661. * SREmptyLanguageObject()
  662. *
  663. * Availability:
  664. * Mac OS X: in version 10.0 and later in Carbon.framework
  665. * CarbonLib: in CarbonLib 1.0 and later
  666. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  667. }
  668. function SREmptyLanguageObject( languageObject: SRLanguageObject ): OSErr; external name '_SREmptyLanguageObject';
  669. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  670. {
  671. * SRChangeLanguageObject()
  672. *
  673. * Availability:
  674. * Mac OS X: in version 10.0 and later in Carbon.framework
  675. * CarbonLib: in CarbonLib 1.0 and later
  676. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  677. }
  678. function SRChangeLanguageObject( languageObject: SRLanguageObject; text: {const} UnivPtr; textLength: SInt32 ): OSErr; external name '_SRChangeLanguageObject';
  679. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  680. {
  681. * SRAddLanguageObject()
  682. *
  683. * Availability:
  684. * Mac OS X: in version 10.0 and later in Carbon.framework
  685. * CarbonLib: in CarbonLib 1.0 and later
  686. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  687. }
  688. function SRAddLanguageObject( base: SRLanguageObject; addon: SRLanguageObject ): OSErr; external name '_SRAddLanguageObject';
  689. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  690. {
  691. * SRAddText()
  692. *
  693. * Availability:
  694. * Mac OS X: in version 10.0 and later in Carbon.framework
  695. * CarbonLib: in CarbonLib 1.0 and later
  696. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  697. }
  698. function SRAddText( base: SRLanguageObject; text: {const} UnivPtr; textLength: SInt32; refCon: SRefCon ): OSErr; external name '_SRAddText';
  699. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  700. {
  701. * SRRemoveLanguageObject()
  702. *
  703. * Availability:
  704. * Mac OS X: in version 10.0 and later in Carbon.framework
  705. * CarbonLib: in CarbonLib 1.0 and later
  706. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  707. }
  708. function SRRemoveLanguageObject( base: SRLanguageObject; toRemove: SRLanguageObject ): OSErr; external name '_SRRemoveLanguageObject';
  709. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  710. { Traversing SRRecognitionResults or SRLanguageObjects }
  711. {
  712. * SRCountItems()
  713. *
  714. * Availability:
  715. * Mac OS X: in version 10.0 and later in Carbon.framework
  716. * CarbonLib: in CarbonLib 1.0 and later
  717. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  718. }
  719. function SRCountItems( container: SRSpeechObject; var count: SIGNEDLONG ): OSErr; external name '_SRCountItems';
  720. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  721. {
  722. * SRGetIndexedItem()
  723. *
  724. * Availability:
  725. * Mac OS X: in version 10.0 and later in Carbon.framework
  726. * CarbonLib: in CarbonLib 1.0 and later
  727. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  728. }
  729. function SRGetIndexedItem( container: SRSpeechObject; var item: SRSpeechObject; index: SIGNEDLONG ): OSErr; external name '_SRGetIndexedItem';
  730. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  731. {
  732. * SRSetIndexedItem()
  733. *
  734. * Availability:
  735. * Mac OS X: in version 10.0 and later in Carbon.framework
  736. * CarbonLib: in CarbonLib 1.0 and later
  737. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  738. }
  739. function SRSetIndexedItem( container: SRSpeechObject; item: SRSpeechObject; index: SIGNEDLONG ): OSErr; external name '_SRSetIndexedItem';
  740. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  741. {
  742. * SRRemoveIndexedItem()
  743. *
  744. * Availability:
  745. * Mac OS X: in version 10.0 and later in Carbon.framework
  746. * CarbonLib: in CarbonLib 1.0 and later
  747. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  748. }
  749. function SRRemoveIndexedItem( container: SRSpeechObject; index: SIGNEDLONG ): OSErr; external name '_SRRemoveIndexedItem';
  750. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  751. { Utilizing the System Feedback Window }
  752. {
  753. * SRDrawText()
  754. *
  755. * Availability:
  756. * Mac OS X: in version 10.0 and later in Carbon.framework
  757. * CarbonLib: in CarbonLib 1.0 and later
  758. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  759. }
  760. function SRDrawText( recognizer: SRRecognizer; dispText: {const} UnivPtr; dispLength: SInt32 ): OSErr; external name '_SRDrawText';
  761. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  762. {
  763. * SRDrawRecognizedText()
  764. *
  765. * Availability:
  766. * Mac OS X: in version 10.0 and later in Carbon.framework
  767. * CarbonLib: in CarbonLib 1.0 and later
  768. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  769. }
  770. function SRDrawRecognizedText( recognizer: SRRecognizer; dispText: {const} UnivPtr; dispLength: SInt32 ): OSErr; external name '_SRDrawRecognizedText';
  771. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  772. {
  773. * SRSpeakText()
  774. *
  775. * Availability:
  776. * Mac OS X: in version 10.0 and later in Carbon.framework
  777. * CarbonLib: in CarbonLib 1.0 and later
  778. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  779. }
  780. function SRSpeakText( recognizer: SRRecognizer; speakText: {const} UnivPtr; speakLength: SInt32 ): OSErr; external name '_SRSpeakText';
  781. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  782. {
  783. * SRSpeakAndDrawText()
  784. *
  785. * Availability:
  786. * Mac OS X: in version 10.0 and later in Carbon.framework
  787. * CarbonLib: in CarbonLib 1.0 and later
  788. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  789. }
  790. function SRSpeakAndDrawText( recognizer: SRRecognizer; text: {const} UnivPtr; textLength: SInt32 ): OSErr; external name '_SRSpeakAndDrawText';
  791. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  792. {
  793. * SRStopSpeech()
  794. *
  795. * Availability:
  796. * Mac OS X: in version 10.0 and later in Carbon.framework
  797. * CarbonLib: in CarbonLib 1.0 and later
  798. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  799. }
  800. function SRStopSpeech( recognizer: SRRecognizer ): OSErr; external name '_SRStopSpeech';
  801. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  802. {
  803. * SRSpeechBusy()
  804. *
  805. * Availability:
  806. * Mac OS X: in version 10.0 and later in Carbon.framework
  807. * CarbonLib: in CarbonLib 1.0 and later
  808. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  809. }
  810. function SRSpeechBusy( recognizer: SRRecognizer ): Boolean; external name '_SRSpeechBusy';
  811. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  812. {
  813. * SRProcessBegin()
  814. *
  815. * Availability:
  816. * Mac OS X: in version 10.0 and later in Carbon.framework
  817. * CarbonLib: in CarbonLib 1.0 and later
  818. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  819. }
  820. function SRProcessBegin( recognizer: SRRecognizer; failed: Boolean ): OSErr; external name '_SRProcessBegin';
  821. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  822. {
  823. * SRProcessEnd()
  824. *
  825. * Availability:
  826. * Mac OS X: in version 10.0 and later in Carbon.framework
  827. * CarbonLib: in CarbonLib 1.0 and later
  828. * Non-Carbon CFM: in SpeechRecognitionLib 1.0 and later
  829. }
  830. function SRProcessEnd( recognizer: SRRecognizer; failed: Boolean ): OSErr; external name '_SRProcessEnd';
  831. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  832. {$endc} {TARGET_OS_MAC}
  833. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  834. end.
  835. {$endc} {not MACOSALLINCLUDE}