SpeechSynthesis.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. {
  2. File: SpeechSynthesis.p
  3. Contains: Speech Interfaces.
  4. Version: Technology: Mac OS 8
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1989-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit SpeechSynthesis;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MixedMode,Files;
  92. {$ALIGN MAC68K}
  93. const
  94. kTextToSpeechSynthType = $74747363 (* 'ttsc' *);
  95. kTextToSpeechVoiceType = $74747664 (* 'ttvd' *);
  96. kTextToSpeechVoiceFileType = $74747666 (* 'ttvf' *);
  97. kTextToSpeechVoiceBundleType = $74747662 (* 'ttvb' *);
  98. kNoEndingProsody = 1;
  99. kNoSpeechInterrupt = 2;
  100. kPreflightThenPause = 4;
  101. kImmediate = 0;
  102. kEndOfWord = 1;
  103. kEndOfSentence = 2;
  104. { ------------------------------------------ }
  105. { GetSpeechInfo & SetSpeechInfo selectors }
  106. { ------------------------------------------ }
  107. soStatus = $73746174 (* 'stat' *);
  108. soErrors = $6572726F (* 'erro' *);
  109. soInputMode = $696E7074 (* 'inpt' *);
  110. soCharacterMode = $63686172 (* 'char' *);
  111. soNumberMode = $6E6D6272 (* 'nmbr' *);
  112. soRate = $72617465 (* 'rate' *);
  113. soPitchBase = $70626173 (* 'pbas' *);
  114. soPitchMod = $706D6F64 (* 'pmod' *);
  115. soVolume = $766F6C6D (* 'volm' *);
  116. soSynthType = $76657273 (* 'vers' *);
  117. soRecentSync = $73796E63 (* 'sync' *);
  118. soPhonemeSymbols = $70687379 (* 'phsy' *);
  119. soCurrentVoice = $63766F78 (* 'cvox' *);
  120. soCommandDelimiter = $646C696D (* 'dlim' *);
  121. soReset = $72736574 (* 'rset' *);
  122. soCurrentA5 = $6D794135 (* 'myA5' *);
  123. soRefCon = $72656663 (* 'refc' *);
  124. soTextDoneCallBack = $74646362 (* 'tdcb' *); { use with SpeechTextDoneProcPtr }
  125. soSpeechDoneCallBack = $73646362 (* 'sdcb' *); { use with SpeechDoneProcPtr }
  126. soSyncCallBack = $73796362 (* 'sycb' *); { use with SpeechSyncProcPtr }
  127. soErrorCallBack = $65726362 (* 'ercb' *); { use with SpeechErrorProcPtr }
  128. soPhonemeCallBack = $70686362 (* 'phcb' *); { use with SpeechPhonemeProcPtr }
  129. soWordCallBack = $77646362 (* 'wdcb' *);
  130. soSynthExtension = $78746E64 (* 'xtnd' *);
  131. soSoundOutput = $736E646F (* 'sndo' *);
  132. { ------------------------------------------ }
  133. { Speaking Mode Constants }
  134. { ------------------------------------------ }
  135. modeText = $54455854 (* 'TEXT' *); { input mode constants }
  136. modePhonemes = $50484F4E (* 'PHON' *);
  137. modeNormal = $4E4F524D (* 'NORM' *); { character mode and number mode constants }
  138. modeLiteral = $4C54524C (* 'LTRL' *);
  139. soVoiceDescription = $696E666F (* 'info' *);
  140. soVoiceFile = $66726566 (* 'fref' *);
  141. type
  142. SpeechChannel = ^SInt32; { an opaque 32-bit type }
  143. SpeechChannelPtr = ^SpeechChannel; { when a var xx:SpeechChannel parameter can be nil, it is changed to xx: SpeechChannelPtr }
  144. VoiceSpecPtr = ^VoiceSpec;
  145. VoiceSpec = record
  146. creator: OSType;
  147. id: OSType;
  148. end;
  149. const
  150. kNeuter = 0;
  151. kMale = 1;
  152. kFemale = 2;
  153. type
  154. VoiceDescriptionPtr = ^VoiceDescription;
  155. VoiceDescription = record
  156. length: SInt32;
  157. voice: VoiceSpec;
  158. version: SInt32;
  159. name: Str63;
  160. comment: Str255;
  161. gender: SInt16;
  162. age: SInt16;
  163. script: SInt16;
  164. language: SInt16;
  165. region: SInt16;
  166. reserved: array [0..3] of SInt32;
  167. end;
  168. VoiceFileInfoPtr = ^VoiceFileInfo;
  169. VoiceFileInfo = record
  170. fileSpec: FSSpec;
  171. resID: SInt16;
  172. end;
  173. SpeechStatusInfoPtr = ^SpeechStatusInfo;
  174. SpeechStatusInfo = record
  175. outputBusy: boolean;
  176. outputPaused: boolean;
  177. inputBytesLeft: SInt32;
  178. phonemeCode: SInt16;
  179. end;
  180. SpeechErrorInfoPtr = ^SpeechErrorInfo;
  181. SpeechErrorInfo = record
  182. count: SInt16;
  183. oldest: OSErr;
  184. oldPos: SInt32;
  185. newest: OSErr;
  186. newPos: SInt32;
  187. end;
  188. SpeechVersionInfoPtr = ^SpeechVersionInfo;
  189. SpeechVersionInfo = record
  190. synthType: OSType;
  191. synthSubType: OSType;
  192. synthManufacturer: OSType;
  193. synthFlags: SInt32;
  194. synthVersion: NumVersion;
  195. end;
  196. PhonemeInfoPtr = ^PhonemeInfo;
  197. PhonemeInfo = record
  198. opcode: SInt16;
  199. phStr: Str15;
  200. exampleStr: Str31;
  201. hiliteStart: SInt16;
  202. hiliteEnd: SInt16;
  203. end;
  204. PhonemeDescriptorPtr = ^PhonemeDescriptor;
  205. PhonemeDescriptor = record
  206. phonemeCount: SInt16;
  207. thePhonemes: array [0..0] of PhonemeInfo;
  208. end;
  209. SpeechXtndDataPtr = ^SpeechXtndData;
  210. SpeechXtndData = packed record
  211. synthCreator: OSType;
  212. synthData: packed array [0..1] of Byte;
  213. end;
  214. DelimiterInfoPtr = ^DelimiterInfo;
  215. DelimiterInfo = packed record
  216. startDelimiter: packed array [0..1] of Byte;
  217. endDelimiter: packed array [0..1] of Byte;
  218. end;
  219. {$ifc TYPED_FUNCTION_POINTERS}
  220. SpeechTextDoneProcPtr = procedure(chan: SpeechChannel; refCon: SInt32; var nextBuf: UnivPtr; var byteLen: UInt32; var controlFlags: SInt32);
  221. {$elsec}
  222. SpeechTextDoneProcPtr = ProcPtr;
  223. {$endc}
  224. {$ifc TYPED_FUNCTION_POINTERS}
  225. SpeechDoneProcPtr = procedure(chan: SpeechChannel; refCon: SInt32);
  226. {$elsec}
  227. SpeechDoneProcPtr = ProcPtr;
  228. {$endc}
  229. {$ifc TYPED_FUNCTION_POINTERS}
  230. SpeechSyncProcPtr = procedure(chan: SpeechChannel; refCon: SInt32; syncMessage: OSType);
  231. {$elsec}
  232. SpeechSyncProcPtr = ProcPtr;
  233. {$endc}
  234. {$ifc TYPED_FUNCTION_POINTERS}
  235. SpeechErrorProcPtr = procedure(chan: SpeechChannel; refCon: SInt32; theError: OSErr; bytePos: SInt32);
  236. {$elsec}
  237. SpeechErrorProcPtr = ProcPtr;
  238. {$endc}
  239. {$ifc TYPED_FUNCTION_POINTERS}
  240. SpeechPhonemeProcPtr = procedure(chan: SpeechChannel; refCon: SInt32; phonemeOpcode: SInt16);
  241. {$elsec}
  242. SpeechPhonemeProcPtr = ProcPtr;
  243. {$endc}
  244. {$ifc TYPED_FUNCTION_POINTERS}
  245. SpeechWordProcPtr = procedure(chan: SpeechChannel; refCon: SInt32; wordPos: UInt32; wordLen: UInt16);
  246. {$elsec}
  247. SpeechWordProcPtr = ProcPtr;
  248. {$endc}
  249. {$ifc OPAQUE_UPP_TYPES}
  250. SpeechTextDoneUPP = ^SInt32; { an opaque UPP }
  251. {$elsec}
  252. SpeechTextDoneUPP = UniversalProcPtr;
  253. {$endc}
  254. {$ifc OPAQUE_UPP_TYPES}
  255. SpeechDoneUPP = ^SInt32; { an opaque UPP }
  256. {$elsec}
  257. SpeechDoneUPP = UniversalProcPtr;
  258. {$endc}
  259. {$ifc OPAQUE_UPP_TYPES}
  260. SpeechSyncUPP = ^SInt32; { an opaque UPP }
  261. {$elsec}
  262. SpeechSyncUPP = UniversalProcPtr;
  263. {$endc}
  264. {$ifc OPAQUE_UPP_TYPES}
  265. SpeechErrorUPP = ^SInt32; { an opaque UPP }
  266. {$elsec}
  267. SpeechErrorUPP = UniversalProcPtr;
  268. {$endc}
  269. {$ifc OPAQUE_UPP_TYPES}
  270. SpeechPhonemeUPP = ^SInt32; { an opaque UPP }
  271. {$elsec}
  272. SpeechPhonemeUPP = UniversalProcPtr;
  273. {$endc}
  274. {$ifc OPAQUE_UPP_TYPES}
  275. SpeechWordUPP = ^SInt32; { an opaque UPP }
  276. {$elsec}
  277. SpeechWordUPP = UniversalProcPtr;
  278. {$endc}
  279. const
  280. uppSpeechTextDoneProcInfo = $0000FFC0;
  281. uppSpeechDoneProcInfo = $000003C0;
  282. uppSpeechSyncProcInfo = $00000FC0;
  283. uppSpeechErrorProcInfo = $00003BC0;
  284. uppSpeechPhonemeProcInfo = $00000BC0;
  285. uppSpeechWordProcInfo = $00002FC0;
  286. {
  287. * NewSpeechTextDoneUPP()
  288. *
  289. * Availability:
  290. * Non-Carbon CFM: available as macro/inline
  291. * CarbonLib: in CarbonLib 1.0.2 and later
  292. * Mac OS X: in version 10.0 and later
  293. }
  294. function NewSpeechTextDoneUPP(userRoutine: SpeechTextDoneProcPtr): SpeechTextDoneUPP; external name '_NewSpeechTextDoneUPP'; { old name was NewSpeechTextDoneProc }
  295. {
  296. * NewSpeechDoneUPP()
  297. *
  298. * Availability:
  299. * Non-Carbon CFM: available as macro/inline
  300. * CarbonLib: in CarbonLib 1.0.2 and later
  301. * Mac OS X: in version 10.0 and later
  302. }
  303. function NewSpeechDoneUPP(userRoutine: SpeechDoneProcPtr): SpeechDoneUPP; external name '_NewSpeechDoneUPP'; { old name was NewSpeechDoneProc }
  304. {
  305. * NewSpeechSyncUPP()
  306. *
  307. * Availability:
  308. * Non-Carbon CFM: available as macro/inline
  309. * CarbonLib: in CarbonLib 1.0.2 and later
  310. * Mac OS X: in version 10.0 and later
  311. }
  312. function NewSpeechSyncUPP(userRoutine: SpeechSyncProcPtr): SpeechSyncUPP; external name '_NewSpeechSyncUPP'; { old name was NewSpeechSyncProc }
  313. {
  314. * NewSpeechErrorUPP()
  315. *
  316. * Availability:
  317. * Non-Carbon CFM: available as macro/inline
  318. * CarbonLib: in CarbonLib 1.0.2 and later
  319. * Mac OS X: in version 10.0 and later
  320. }
  321. function NewSpeechErrorUPP(userRoutine: SpeechErrorProcPtr): SpeechErrorUPP; external name '_NewSpeechErrorUPP'; { old name was NewSpeechErrorProc }
  322. {
  323. * NewSpeechPhonemeUPP()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: available as macro/inline
  327. * CarbonLib: in CarbonLib 1.0.2 and later
  328. * Mac OS X: in version 10.0 and later
  329. }
  330. function NewSpeechPhonemeUPP(userRoutine: SpeechPhonemeProcPtr): SpeechPhonemeUPP; external name '_NewSpeechPhonemeUPP'; { old name was NewSpeechPhonemeProc }
  331. {
  332. * NewSpeechWordUPP()
  333. *
  334. * Availability:
  335. * Non-Carbon CFM: available as macro/inline
  336. * CarbonLib: in CarbonLib 1.0.2 and later
  337. * Mac OS X: in version 10.0 and later
  338. }
  339. function NewSpeechWordUPP(userRoutine: SpeechWordProcPtr): SpeechWordUPP; external name '_NewSpeechWordUPP'; { old name was NewSpeechWordProc }
  340. {
  341. * DisposeSpeechTextDoneUPP()
  342. *
  343. * Availability:
  344. * Non-Carbon CFM: available as macro/inline
  345. * CarbonLib: in CarbonLib 1.0.2 and later
  346. * Mac OS X: in version 10.0 and later
  347. }
  348. procedure DisposeSpeechTextDoneUPP(userUPP: SpeechTextDoneUPP); external name '_DisposeSpeechTextDoneUPP';
  349. {
  350. * DisposeSpeechDoneUPP()
  351. *
  352. * Availability:
  353. * Non-Carbon CFM: available as macro/inline
  354. * CarbonLib: in CarbonLib 1.0.2 and later
  355. * Mac OS X: in version 10.0 and later
  356. }
  357. procedure DisposeSpeechDoneUPP(userUPP: SpeechDoneUPP); external name '_DisposeSpeechDoneUPP';
  358. {
  359. * DisposeSpeechSyncUPP()
  360. *
  361. * Availability:
  362. * Non-Carbon CFM: available as macro/inline
  363. * CarbonLib: in CarbonLib 1.0.2 and later
  364. * Mac OS X: in version 10.0 and later
  365. }
  366. procedure DisposeSpeechSyncUPP(userUPP: SpeechSyncUPP); external name '_DisposeSpeechSyncUPP';
  367. {
  368. * DisposeSpeechErrorUPP()
  369. *
  370. * Availability:
  371. * Non-Carbon CFM: available as macro/inline
  372. * CarbonLib: in CarbonLib 1.0.2 and later
  373. * Mac OS X: in version 10.0 and later
  374. }
  375. procedure DisposeSpeechErrorUPP(userUPP: SpeechErrorUPP); external name '_DisposeSpeechErrorUPP';
  376. {
  377. * DisposeSpeechPhonemeUPP()
  378. *
  379. * Availability:
  380. * Non-Carbon CFM: available as macro/inline
  381. * CarbonLib: in CarbonLib 1.0.2 and later
  382. * Mac OS X: in version 10.0 and later
  383. }
  384. procedure DisposeSpeechPhonemeUPP(userUPP: SpeechPhonemeUPP); external name '_DisposeSpeechPhonemeUPP';
  385. {
  386. * DisposeSpeechWordUPP()
  387. *
  388. * Availability:
  389. * Non-Carbon CFM: available as macro/inline
  390. * CarbonLib: in CarbonLib 1.0.2 and later
  391. * Mac OS X: in version 10.0 and later
  392. }
  393. procedure DisposeSpeechWordUPP(userUPP: SpeechWordUPP); external name '_DisposeSpeechWordUPP';
  394. {
  395. * InvokeSpeechTextDoneUPP()
  396. *
  397. * Availability:
  398. * Non-Carbon CFM: available as macro/inline
  399. * CarbonLib: in CarbonLib 1.0.2 and later
  400. * Mac OS X: in version 10.0 and later
  401. }
  402. procedure InvokeSpeechTextDoneUPP(chan: SpeechChannel; refCon: SInt32; var nextBuf: UnivPtr; var byteLen: UInt32; var controlFlags: SInt32; userRoutine: SpeechTextDoneUPP); external name '_InvokeSpeechTextDoneUPP'; { old name was CallSpeechTextDoneProc }
  403. {
  404. * InvokeSpeechDoneUPP()
  405. *
  406. * Availability:
  407. * Non-Carbon CFM: available as macro/inline
  408. * CarbonLib: in CarbonLib 1.0.2 and later
  409. * Mac OS X: in version 10.0 and later
  410. }
  411. procedure InvokeSpeechDoneUPP(chan: SpeechChannel; refCon: SInt32; userRoutine: SpeechDoneUPP); external name '_InvokeSpeechDoneUPP'; { old name was CallSpeechDoneProc }
  412. {
  413. * InvokeSpeechSyncUPP()
  414. *
  415. * Availability:
  416. * Non-Carbon CFM: available as macro/inline
  417. * CarbonLib: in CarbonLib 1.0.2 and later
  418. * Mac OS X: in version 10.0 and later
  419. }
  420. procedure InvokeSpeechSyncUPP(chan: SpeechChannel; refCon: SInt32; syncMessage: OSType; userRoutine: SpeechSyncUPP); external name '_InvokeSpeechSyncUPP'; { old name was CallSpeechSyncProc }
  421. {
  422. * InvokeSpeechErrorUPP()
  423. *
  424. * Availability:
  425. * Non-Carbon CFM: available as macro/inline
  426. * CarbonLib: in CarbonLib 1.0.2 and later
  427. * Mac OS X: in version 10.0 and later
  428. }
  429. procedure InvokeSpeechErrorUPP(chan: SpeechChannel; refCon: SInt32; theError: OSErr; bytePos: SInt32; userRoutine: SpeechErrorUPP); external name '_InvokeSpeechErrorUPP'; { old name was CallSpeechErrorProc }
  430. {
  431. * InvokeSpeechPhonemeUPP()
  432. *
  433. * Availability:
  434. * Non-Carbon CFM: available as macro/inline
  435. * CarbonLib: in CarbonLib 1.0.2 and later
  436. * Mac OS X: in version 10.0 and later
  437. }
  438. procedure InvokeSpeechPhonemeUPP(chan: SpeechChannel; refCon: SInt32; phonemeOpcode: SInt16; userRoutine: SpeechPhonemeUPP); external name '_InvokeSpeechPhonemeUPP'; { old name was CallSpeechPhonemeProc }
  439. {
  440. * InvokeSpeechWordUPP()
  441. *
  442. * Availability:
  443. * Non-Carbon CFM: available as macro/inline
  444. * CarbonLib: in CarbonLib 1.0.2 and later
  445. * Mac OS X: in version 10.0 and later
  446. }
  447. procedure InvokeSpeechWordUPP(chan: SpeechChannel; refCon: SInt32; wordPos: UInt32; wordLen: UInt16; userRoutine: SpeechWordUPP); external name '_InvokeSpeechWordUPP'; { old name was CallSpeechWordProc }
  448. {
  449. * SpeechManagerVersion()
  450. *
  451. * Availability:
  452. * Non-Carbon CFM: in SpeechLib 1.0 and later
  453. * CarbonLib: in CarbonLib 1.0 and later
  454. * Mac OS X: in version 10.0 and later
  455. }
  456. function SpeechManagerVersion: NumVersion; external name '_SpeechManagerVersion';
  457. {
  458. * MakeVoiceSpec()
  459. *
  460. * Availability:
  461. * Non-Carbon CFM: in SpeechLib 1.0 and later
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Mac OS X: in version 10.0 and later
  464. }
  465. function MakeVoiceSpec(creator: OSType; id: OSType; var voice: VoiceSpec): OSErr; external name '_MakeVoiceSpec';
  466. {
  467. * CountVoices()
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: in SpeechLib 1.0 and later
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Mac OS X: in version 10.0 and later
  473. }
  474. function CountVoices(var numVoices: SInt16): OSErr; external name '_CountVoices';
  475. {
  476. * GetIndVoice()
  477. *
  478. * Availability:
  479. * Non-Carbon CFM: in SpeechLib 1.0 and later
  480. * CarbonLib: in CarbonLib 1.0 and later
  481. * Mac OS X: in version 10.0 and later
  482. }
  483. function GetIndVoice(index: SInt16; var voice: VoiceSpec): OSErr; external name '_GetIndVoice';
  484. {
  485. * GetVoiceDescription()
  486. *
  487. * Availability:
  488. * Non-Carbon CFM: in SpeechLib 1.0 and later
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Mac OS X: in version 10.0 and later
  491. }
  492. function GetVoiceDescription(const (*var*) voice: VoiceSpec; var info: VoiceDescription; infoLength: SInt32): OSErr; external name '_GetVoiceDescription';
  493. {
  494. * GetVoiceInfo()
  495. *
  496. * Availability:
  497. * Non-Carbon CFM: in SpeechLib 1.0 and later
  498. * CarbonLib: in CarbonLib 1.0 and later
  499. * Mac OS X: in version 10.0 and later
  500. }
  501. function GetVoiceInfo(const (*var*) voice: VoiceSpec; selector: OSType; voiceInfo: UnivPtr): OSErr; external name '_GetVoiceInfo';
  502. {
  503. * NewSpeechChannel()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: in SpeechLib 1.0 and later
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Mac OS X: in version 10.0 and later
  509. }
  510. function NewSpeechChannel(voice: VoiceSpecPtr; var chan: SpeechChannel): OSErr; external name '_NewSpeechChannel';
  511. {
  512. * DisposeSpeechChannel()
  513. *
  514. * Availability:
  515. * Non-Carbon CFM: in SpeechLib 1.0 and later
  516. * CarbonLib: in CarbonLib 1.0 and later
  517. * Mac OS X: in version 10.0 and later
  518. }
  519. function DisposeSpeechChannel(chan: SpeechChannel): OSErr; external name '_DisposeSpeechChannel';
  520. {
  521. * SpeakString()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in SpeechLib 1.0 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. }
  528. function SpeakString(const (*var*) textToBeSpoken: Str255): OSErr; external name '_SpeakString';
  529. {
  530. * SpeakText()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in SpeechLib 1.0 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. }
  537. function SpeakText(chan: SpeechChannel; textBuf: UnivPtr; textBytes: UInt32): OSErr; external name '_SpeakText';
  538. {
  539. * SpeakBuffer()
  540. *
  541. * Availability:
  542. * Non-Carbon CFM: in SpeechLib 1.0 and later
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Mac OS X: in version 10.0 and later
  545. }
  546. function SpeakBuffer(chan: SpeechChannel; textBuf: UnivPtr; textBytes: UInt32; controlFlags: SInt32): OSErr; external name '_SpeakBuffer';
  547. {
  548. * StopSpeech()
  549. *
  550. * Availability:
  551. * Non-Carbon CFM: in SpeechLib 1.0 and later
  552. * CarbonLib: in CarbonLib 1.0 and later
  553. * Mac OS X: in version 10.0 and later
  554. }
  555. function StopSpeech(chan: SpeechChannel): OSErr; external name '_StopSpeech';
  556. {
  557. * StopSpeechAt()
  558. *
  559. * Availability:
  560. * Non-Carbon CFM: in SpeechLib 1.0 and later
  561. * CarbonLib: in CarbonLib 1.0 and later
  562. * Mac OS X: in version 10.0 and later
  563. }
  564. function StopSpeechAt(chan: SpeechChannel; whereToStop: SInt32): OSErr; external name '_StopSpeechAt';
  565. {
  566. * PauseSpeechAt()
  567. *
  568. * Availability:
  569. * Non-Carbon CFM: in SpeechLib 1.0 and later
  570. * CarbonLib: in CarbonLib 1.0 and later
  571. * Mac OS X: in version 10.0 and later
  572. }
  573. function PauseSpeechAt(chan: SpeechChannel; whereToPause: SInt32): OSErr; external name '_PauseSpeechAt';
  574. {
  575. * ContinueSpeech()
  576. *
  577. * Availability:
  578. * Non-Carbon CFM: in SpeechLib 1.0 and later
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Mac OS X: in version 10.0 and later
  581. }
  582. function ContinueSpeech(chan: SpeechChannel): OSErr; external name '_ContinueSpeech';
  583. {
  584. * SpeechBusy()
  585. *
  586. * Availability:
  587. * Non-Carbon CFM: in SpeechLib 1.0 and later
  588. * CarbonLib: in CarbonLib 1.0 and later
  589. * Mac OS X: in version 10.0 and later
  590. }
  591. function SpeechBusy: SInt16; external name '_SpeechBusy';
  592. {
  593. * SpeechBusySystemWide()
  594. *
  595. * Availability:
  596. * Non-Carbon CFM: in SpeechLib 1.0 and later
  597. * CarbonLib: in CarbonLib 1.0 and later
  598. * Mac OS X: in version 10.0 and later
  599. }
  600. function SpeechBusySystemWide: SInt16; external name '_SpeechBusySystemWide';
  601. {
  602. * SetSpeechRate()
  603. *
  604. * Availability:
  605. * Non-Carbon CFM: in SpeechLib 1.0 and later
  606. * CarbonLib: in CarbonLib 1.0 and later
  607. * Mac OS X: in version 10.0 and later
  608. }
  609. function SetSpeechRate(chan: SpeechChannel; rate: Fixed): OSErr; external name '_SetSpeechRate';
  610. {
  611. * GetSpeechRate()
  612. *
  613. * Availability:
  614. * Non-Carbon CFM: in SpeechLib 1.0 and later
  615. * CarbonLib: in CarbonLib 1.0 and later
  616. * Mac OS X: in version 10.0 and later
  617. }
  618. function GetSpeechRate(chan: SpeechChannel; var rate: Fixed): OSErr; external name '_GetSpeechRate';
  619. {
  620. * SetSpeechPitch()
  621. *
  622. * Availability:
  623. * Non-Carbon CFM: in SpeechLib 1.0 and later
  624. * CarbonLib: in CarbonLib 1.0 and later
  625. * Mac OS X: in version 10.0 and later
  626. }
  627. function SetSpeechPitch(chan: SpeechChannel; pitch: Fixed): OSErr; external name '_SetSpeechPitch';
  628. {
  629. * GetSpeechPitch()
  630. *
  631. * Availability:
  632. * Non-Carbon CFM: in SpeechLib 1.0 and later
  633. * CarbonLib: in CarbonLib 1.0 and later
  634. * Mac OS X: in version 10.0 and later
  635. }
  636. function GetSpeechPitch(chan: SpeechChannel; var pitch: Fixed): OSErr; external name '_GetSpeechPitch';
  637. {
  638. * SetSpeechInfo()
  639. *
  640. * Availability:
  641. * Non-Carbon CFM: in SpeechLib 1.0 and later
  642. * CarbonLib: in CarbonLib 1.0 and later
  643. * Mac OS X: in version 10.0 and later
  644. }
  645. function SetSpeechInfo(chan: SpeechChannel; selector: OSType; speechInfo: UnivPtr): OSErr; external name '_SetSpeechInfo';
  646. {
  647. * GetSpeechInfo()
  648. *
  649. * Availability:
  650. * Non-Carbon CFM: in SpeechLib 1.0 and later
  651. * CarbonLib: in CarbonLib 1.0 and later
  652. * Mac OS X: in version 10.0 and later
  653. }
  654. function GetSpeechInfo(chan: SpeechChannel; selector: OSType; speechInfo: UnivPtr): OSErr; external name '_GetSpeechInfo';
  655. {
  656. * TextToPhonemes()
  657. *
  658. * Availability:
  659. * Non-Carbon CFM: in SpeechLib 1.0 and later
  660. * CarbonLib: in CarbonLib 1.0 and later
  661. * Mac OS X: in version 10.0 and later
  662. }
  663. function TextToPhonemes(chan: SpeechChannel; textBuf: UnivPtr; textBytes: UInt32; phonemeBuf: Handle; var phonemeBytes: SInt32): OSErr; external name '_TextToPhonemes';
  664. {
  665. * UseDictionary()
  666. *
  667. * Availability:
  668. * Non-Carbon CFM: in SpeechLib 1.0 and later
  669. * CarbonLib: in CarbonLib 1.0 and later
  670. * Mac OS X: in version 10.0 and later
  671. }
  672. function UseDictionary(chan: SpeechChannel; dictionary: Handle): OSErr; external name '_UseDictionary';
  673. {$ALIGN MAC68K}
  674. end.