Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

968 lines
31 KiB

  1. /*
  2. File: SpeechSynthesis.h
  3. Contains: Speech Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1989-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __SPEECHSYNTHESIS__
  11. #define __SPEECHSYNTHESIS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. #ifndef __FILES__
  19. #include <Files.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. enum {
  38. kTextToSpeechSynthType = FOUR_CHAR_CODE('ttsc'),
  39. kTextToSpeechVoiceType = FOUR_CHAR_CODE('ttvd'),
  40. kTextToSpeechVoiceFileType = FOUR_CHAR_CODE('ttvf'),
  41. kTextToSpeechVoiceBundleType = FOUR_CHAR_CODE('ttvb')
  42. };
  43. enum {
  44. kNoEndingProsody = 1,
  45. kNoSpeechInterrupt = 2,
  46. kPreflightThenPause = 4
  47. };
  48. enum {
  49. kImmediate = 0,
  50. kEndOfWord = 1,
  51. kEndOfSentence = 2
  52. };
  53. /*------------------------------------------*/
  54. /* GetSpeechInfo & SetSpeechInfo selectors */
  55. /*------------------------------------------*/
  56. enum {
  57. soStatus = FOUR_CHAR_CODE('stat'),
  58. soErrors = FOUR_CHAR_CODE('erro'),
  59. soInputMode = FOUR_CHAR_CODE('inpt'),
  60. soCharacterMode = FOUR_CHAR_CODE('char'),
  61. soNumberMode = FOUR_CHAR_CODE('nmbr'),
  62. soRate = FOUR_CHAR_CODE('rate'),
  63. soPitchBase = FOUR_CHAR_CODE('pbas'),
  64. soPitchMod = FOUR_CHAR_CODE('pmod'),
  65. soVolume = FOUR_CHAR_CODE('volm'),
  66. soSynthType = FOUR_CHAR_CODE('vers'),
  67. soRecentSync = FOUR_CHAR_CODE('sync'),
  68. soPhonemeSymbols = FOUR_CHAR_CODE('phsy'),
  69. soCurrentVoice = FOUR_CHAR_CODE('cvox'),
  70. soCommandDelimiter = FOUR_CHAR_CODE('dlim'),
  71. soReset = FOUR_CHAR_CODE('rset'),
  72. soCurrentA5 = FOUR_CHAR_CODE('myA5'),
  73. soRefCon = FOUR_CHAR_CODE('refc'),
  74. soTextDoneCallBack = FOUR_CHAR_CODE('tdcb'), /* use with SpeechTextDoneProcPtr*/
  75. soSpeechDoneCallBack = FOUR_CHAR_CODE('sdcb'), /* use with SpeechDoneProcPtr*/
  76. soSyncCallBack = FOUR_CHAR_CODE('sycb'), /* use with SpeechSyncProcPtr*/
  77. soErrorCallBack = FOUR_CHAR_CODE('ercb'), /* use with SpeechErrorProcPtr*/
  78. soPhonemeCallBack = FOUR_CHAR_CODE('phcb'), /* use with SpeechPhonemeProcPtr*/
  79. soWordCallBack = FOUR_CHAR_CODE('wdcb'),
  80. soSynthExtension = FOUR_CHAR_CODE('xtnd'),
  81. soSoundOutput = FOUR_CHAR_CODE('sndo')
  82. };
  83. /*------------------------------------------*/
  84. /* Speaking Mode Constants */
  85. /*------------------------------------------*/
  86. enum {
  87. modeText = FOUR_CHAR_CODE('TEXT'), /* input mode constants */
  88. modePhonemes = FOUR_CHAR_CODE('PHON'),
  89. modeNormal = FOUR_CHAR_CODE('NORM'), /* character mode and number mode constants */
  90. modeLiteral = FOUR_CHAR_CODE('LTRL')
  91. };
  92. enum {
  93. soVoiceDescription = FOUR_CHAR_CODE('info'),
  94. soVoiceFile = FOUR_CHAR_CODE('fref')
  95. };
  96. typedef struct OpaqueSpeechChannel* SpeechChannel;
  97. struct VoiceSpec {
  98. OSType creator;
  99. OSType id;
  100. };
  101. typedef struct VoiceSpec VoiceSpec;
  102. typedef VoiceSpec * VoiceSpecPtr;
  103. enum {
  104. kNeuter = 0,
  105. kMale = 1,
  106. kFemale = 2
  107. };
  108. struct VoiceDescription {
  109. long length;
  110. VoiceSpec voice;
  111. long version;
  112. Str63 name;
  113. Str255 comment;
  114. short gender;
  115. short age;
  116. short script;
  117. short language;
  118. short region;
  119. long reserved[4];
  120. };
  121. typedef struct VoiceDescription VoiceDescription;
  122. struct VoiceFileInfo {
  123. FSSpec fileSpec;
  124. short resID;
  125. };
  126. typedef struct VoiceFileInfo VoiceFileInfo;
  127. struct SpeechStatusInfo {
  128. Boolean outputBusy;
  129. Boolean outputPaused;
  130. long inputBytesLeft;
  131. short phonemeCode;
  132. };
  133. typedef struct SpeechStatusInfo SpeechStatusInfo;
  134. struct SpeechErrorInfo {
  135. short count;
  136. OSErr oldest;
  137. long oldPos;
  138. OSErr newest;
  139. long newPos;
  140. };
  141. typedef struct SpeechErrorInfo SpeechErrorInfo;
  142. struct SpeechVersionInfo {
  143. OSType synthType;
  144. OSType synthSubType;
  145. OSType synthManufacturer;
  146. long synthFlags;
  147. NumVersion synthVersion;
  148. };
  149. typedef struct SpeechVersionInfo SpeechVersionInfo;
  150. struct PhonemeInfo {
  151. short opcode;
  152. Str15 phStr;
  153. Str31 exampleStr;
  154. short hiliteStart;
  155. short hiliteEnd;
  156. };
  157. typedef struct PhonemeInfo PhonemeInfo;
  158. struct PhonemeDescriptor {
  159. short phonemeCount;
  160. PhonemeInfo thePhonemes[1];
  161. };
  162. typedef struct PhonemeDescriptor PhonemeDescriptor;
  163. struct SpeechXtndData {
  164. OSType synthCreator;
  165. Byte synthData[2];
  166. };
  167. typedef struct SpeechXtndData SpeechXtndData;
  168. struct DelimiterInfo {
  169. Byte startDelimiter[2];
  170. Byte endDelimiter[2];
  171. };
  172. typedef struct DelimiterInfo DelimiterInfo;
  173. typedef CALLBACK_API( void , SpeechTextDoneProcPtr )(SpeechChannel chan, long refCon, const void **nextBuf, unsigned long *byteLen, long *controlFlags);
  174. typedef CALLBACK_API( void , SpeechDoneProcPtr )(SpeechChannel chan, long refCon);
  175. typedef CALLBACK_API( void , SpeechSyncProcPtr )(SpeechChannel chan, long refCon, OSType syncMessage);
  176. typedef CALLBACK_API( void , SpeechErrorProcPtr )(SpeechChannel chan, long refCon, OSErr theError, long bytePos);
  177. typedef CALLBACK_API( void , SpeechPhonemeProcPtr )(SpeechChannel chan, long refCon, short phonemeOpcode);
  178. typedef CALLBACK_API( void , SpeechWordProcPtr )(SpeechChannel chan, long refCon, unsigned long wordPos, unsigned short wordLen);
  179. typedef STACK_UPP_TYPE(SpeechTextDoneProcPtr) SpeechTextDoneUPP;
  180. typedef STACK_UPP_TYPE(SpeechDoneProcPtr) SpeechDoneUPP;
  181. typedef STACK_UPP_TYPE(SpeechSyncProcPtr) SpeechSyncUPP;
  182. typedef STACK_UPP_TYPE(SpeechErrorProcPtr) SpeechErrorUPP;
  183. typedef STACK_UPP_TYPE(SpeechPhonemeProcPtr) SpeechPhonemeUPP;
  184. typedef STACK_UPP_TYPE(SpeechWordProcPtr) SpeechWordUPP;
  185. /*
  186. * NewSpeechTextDoneUPP()
  187. *
  188. * Availability:
  189. * Non-Carbon CFM: available as macro/inline
  190. * CarbonLib: in CarbonLib 1.0.2 and later
  191. * Mac OS X: in version 10.0 and later
  192. */
  193. EXTERN_API_C( SpeechTextDoneUPP )
  194. NewSpeechTextDoneUPP(SpeechTextDoneProcPtr userRoutine);
  195. #if !OPAQUE_UPP_TYPES
  196. enum { uppSpeechTextDoneProcInfo = 0x0000FFC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  197. #ifdef __cplusplus
  198. inline DEFINE_API_C(SpeechTextDoneUPP) NewSpeechTextDoneUPP(SpeechTextDoneProcPtr userRoutine) { return (SpeechTextDoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechTextDoneProcInfo, GetCurrentArchitecture()); }
  199. #else
  200. #define NewSpeechTextDoneUPP(userRoutine) (SpeechTextDoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechTextDoneProcInfo, GetCurrentArchitecture())
  201. #endif
  202. #endif
  203. /*
  204. * NewSpeechDoneUPP()
  205. *
  206. * Availability:
  207. * Non-Carbon CFM: available as macro/inline
  208. * CarbonLib: in CarbonLib 1.0.2 and later
  209. * Mac OS X: in version 10.0 and later
  210. */
  211. EXTERN_API_C( SpeechDoneUPP )
  212. NewSpeechDoneUPP(SpeechDoneProcPtr userRoutine);
  213. #if !OPAQUE_UPP_TYPES
  214. enum { uppSpeechDoneProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
  215. #ifdef __cplusplus
  216. inline DEFINE_API_C(SpeechDoneUPP) NewSpeechDoneUPP(SpeechDoneProcPtr userRoutine) { return (SpeechDoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechDoneProcInfo, GetCurrentArchitecture()); }
  217. #else
  218. #define NewSpeechDoneUPP(userRoutine) (SpeechDoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechDoneProcInfo, GetCurrentArchitecture())
  219. #endif
  220. #endif
  221. /*
  222. * NewSpeechSyncUPP()
  223. *
  224. * Availability:
  225. * Non-Carbon CFM: available as macro/inline
  226. * CarbonLib: in CarbonLib 1.0.2 and later
  227. * Mac OS X: in version 10.0 and later
  228. */
  229. EXTERN_API_C( SpeechSyncUPP )
  230. NewSpeechSyncUPP(SpeechSyncProcPtr userRoutine);
  231. #if !OPAQUE_UPP_TYPES
  232. enum { uppSpeechSyncProcInfo = 0x00000FC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  233. #ifdef __cplusplus
  234. inline DEFINE_API_C(SpeechSyncUPP) NewSpeechSyncUPP(SpeechSyncProcPtr userRoutine) { return (SpeechSyncUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechSyncProcInfo, GetCurrentArchitecture()); }
  235. #else
  236. #define NewSpeechSyncUPP(userRoutine) (SpeechSyncUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechSyncProcInfo, GetCurrentArchitecture())
  237. #endif
  238. #endif
  239. /*
  240. * NewSpeechErrorUPP()
  241. *
  242. * Availability:
  243. * Non-Carbon CFM: available as macro/inline
  244. * CarbonLib: in CarbonLib 1.0.2 and later
  245. * Mac OS X: in version 10.0 and later
  246. */
  247. EXTERN_API_C( SpeechErrorUPP )
  248. NewSpeechErrorUPP(SpeechErrorProcPtr userRoutine);
  249. #if !OPAQUE_UPP_TYPES
  250. enum { uppSpeechErrorProcInfo = 0x00003BC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes, 4_bytes) */
  251. #ifdef __cplusplus
  252. inline DEFINE_API_C(SpeechErrorUPP) NewSpeechErrorUPP(SpeechErrorProcPtr userRoutine) { return (SpeechErrorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechErrorProcInfo, GetCurrentArchitecture()); }
  253. #else
  254. #define NewSpeechErrorUPP(userRoutine) (SpeechErrorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechErrorProcInfo, GetCurrentArchitecture())
  255. #endif
  256. #endif
  257. /*
  258. * NewSpeechPhonemeUPP()
  259. *
  260. * Availability:
  261. * Non-Carbon CFM: available as macro/inline
  262. * CarbonLib: in CarbonLib 1.0.2 and later
  263. * Mac OS X: in version 10.0 and later
  264. */
  265. EXTERN_API_C( SpeechPhonemeUPP )
  266. NewSpeechPhonemeUPP(SpeechPhonemeProcPtr userRoutine);
  267. #if !OPAQUE_UPP_TYPES
  268. enum { uppSpeechPhonemeProcInfo = 0x00000BC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes) */
  269. #ifdef __cplusplus
  270. inline DEFINE_API_C(SpeechPhonemeUPP) NewSpeechPhonemeUPP(SpeechPhonemeProcPtr userRoutine) { return (SpeechPhonemeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechPhonemeProcInfo, GetCurrentArchitecture()); }
  271. #else
  272. #define NewSpeechPhonemeUPP(userRoutine) (SpeechPhonemeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechPhonemeProcInfo, GetCurrentArchitecture())
  273. #endif
  274. #endif
  275. /*
  276. * NewSpeechWordUPP()
  277. *
  278. * Availability:
  279. * Non-Carbon CFM: available as macro/inline
  280. * CarbonLib: in CarbonLib 1.0.2 and later
  281. * Mac OS X: in version 10.0 and later
  282. */
  283. EXTERN_API_C( SpeechWordUPP )
  284. NewSpeechWordUPP(SpeechWordProcPtr userRoutine);
  285. #if !OPAQUE_UPP_TYPES
  286. enum { uppSpeechWordProcInfo = 0x00002FC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 2_bytes) */
  287. #ifdef __cplusplus
  288. inline DEFINE_API_C(SpeechWordUPP) NewSpeechWordUPP(SpeechWordProcPtr userRoutine) { return (SpeechWordUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechWordProcInfo, GetCurrentArchitecture()); }
  289. #else
  290. #define NewSpeechWordUPP(userRoutine) (SpeechWordUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSpeechWordProcInfo, GetCurrentArchitecture())
  291. #endif
  292. #endif
  293. /*
  294. * DisposeSpeechTextDoneUPP()
  295. *
  296. * Availability:
  297. * Non-Carbon CFM: available as macro/inline
  298. * CarbonLib: in CarbonLib 1.0.2 and later
  299. * Mac OS X: in version 10.0 and later
  300. */
  301. EXTERN_API_C( void )
  302. DisposeSpeechTextDoneUPP(SpeechTextDoneUPP userUPP);
  303. #if !OPAQUE_UPP_TYPES
  304. #ifdef __cplusplus
  305. inline DEFINE_API_C(void) DisposeSpeechTextDoneUPP(SpeechTextDoneUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  306. #else
  307. #define DisposeSpeechTextDoneUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  308. #endif
  309. #endif
  310. /*
  311. * DisposeSpeechDoneUPP()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: available as macro/inline
  315. * CarbonLib: in CarbonLib 1.0.2 and later
  316. * Mac OS X: in version 10.0 and later
  317. */
  318. EXTERN_API_C( void )
  319. DisposeSpeechDoneUPP(SpeechDoneUPP userUPP);
  320. #if !OPAQUE_UPP_TYPES
  321. #ifdef __cplusplus
  322. inline DEFINE_API_C(void) DisposeSpeechDoneUPP(SpeechDoneUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  323. #else
  324. #define DisposeSpeechDoneUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  325. #endif
  326. #endif
  327. /*
  328. * DisposeSpeechSyncUPP()
  329. *
  330. * Availability:
  331. * Non-Carbon CFM: available as macro/inline
  332. * CarbonLib: in CarbonLib 1.0.2 and later
  333. * Mac OS X: in version 10.0 and later
  334. */
  335. EXTERN_API_C( void )
  336. DisposeSpeechSyncUPP(SpeechSyncUPP userUPP);
  337. #if !OPAQUE_UPP_TYPES
  338. #ifdef __cplusplus
  339. inline DEFINE_API_C(void) DisposeSpeechSyncUPP(SpeechSyncUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  340. #else
  341. #define DisposeSpeechSyncUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  342. #endif
  343. #endif
  344. /*
  345. * DisposeSpeechErrorUPP()
  346. *
  347. * Availability:
  348. * Non-Carbon CFM: available as macro/inline
  349. * CarbonLib: in CarbonLib 1.0.2 and later
  350. * Mac OS X: in version 10.0 and later
  351. */
  352. EXTERN_API_C( void )
  353. DisposeSpeechErrorUPP(SpeechErrorUPP userUPP);
  354. #if !OPAQUE_UPP_TYPES
  355. #ifdef __cplusplus
  356. inline DEFINE_API_C(void) DisposeSpeechErrorUPP(SpeechErrorUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  357. #else
  358. #define DisposeSpeechErrorUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  359. #endif
  360. #endif
  361. /*
  362. * DisposeSpeechPhonemeUPP()
  363. *
  364. * Availability:
  365. * Non-Carbon CFM: available as macro/inline
  366. * CarbonLib: in CarbonLib 1.0.2 and later
  367. * Mac OS X: in version 10.0 and later
  368. */
  369. EXTERN_API_C( void )
  370. DisposeSpeechPhonemeUPP(SpeechPhonemeUPP userUPP);
  371. #if !OPAQUE_UPP_TYPES
  372. #ifdef __cplusplus
  373. inline DEFINE_API_C(void) DisposeSpeechPhonemeUPP(SpeechPhonemeUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  374. #else
  375. #define DisposeSpeechPhonemeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  376. #endif
  377. #endif
  378. /*
  379. * DisposeSpeechWordUPP()
  380. *
  381. * Availability:
  382. * Non-Carbon CFM: available as macro/inline
  383. * CarbonLib: in CarbonLib 1.0.2 and later
  384. * Mac OS X: in version 10.0 and later
  385. */
  386. EXTERN_API_C( void )
  387. DisposeSpeechWordUPP(SpeechWordUPP userUPP);
  388. #if !OPAQUE_UPP_TYPES
  389. #ifdef __cplusplus
  390. inline DEFINE_API_C(void) DisposeSpeechWordUPP(SpeechWordUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  391. #else
  392. #define DisposeSpeechWordUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  393. #endif
  394. #endif
  395. /*
  396. * InvokeSpeechTextDoneUPP()
  397. *
  398. * Availability:
  399. * Non-Carbon CFM: available as macro/inline
  400. * CarbonLib: in CarbonLib 1.0.2 and later
  401. * Mac OS X: in version 10.0 and later
  402. */
  403. EXTERN_API_C( void )
  404. InvokeSpeechTextDoneUPP(
  405. SpeechChannel chan,
  406. long refCon,
  407. const void ** nextBuf,
  408. unsigned long * byteLen,
  409. long * controlFlags,
  410. SpeechTextDoneUPP userUPP);
  411. #if !OPAQUE_UPP_TYPES
  412. #ifdef __cplusplus
  413. inline DEFINE_API_C(void) InvokeSpeechTextDoneUPP(SpeechChannel chan, long refCon, const void ** nextBuf, unsigned long * byteLen, long * controlFlags, SpeechTextDoneUPP userUPP) { CALL_FIVE_PARAMETER_UPP(userUPP, uppSpeechTextDoneProcInfo, chan, refCon, nextBuf, byteLen, controlFlags); }
  414. #else
  415. #define InvokeSpeechTextDoneUPP(chan, refCon, nextBuf, byteLen, controlFlags, userUPP) CALL_FIVE_PARAMETER_UPP((userUPP), uppSpeechTextDoneProcInfo, (chan), (refCon), (nextBuf), (byteLen), (controlFlags))
  416. #endif
  417. #endif
  418. /*
  419. * InvokeSpeechDoneUPP()
  420. *
  421. * Availability:
  422. * Non-Carbon CFM: available as macro/inline
  423. * CarbonLib: in CarbonLib 1.0.2 and later
  424. * Mac OS X: in version 10.0 and later
  425. */
  426. EXTERN_API_C( void )
  427. InvokeSpeechDoneUPP(
  428. SpeechChannel chan,
  429. long refCon,
  430. SpeechDoneUPP userUPP);
  431. #if !OPAQUE_UPP_TYPES
  432. #ifdef __cplusplus
  433. inline DEFINE_API_C(void) InvokeSpeechDoneUPP(SpeechChannel chan, long refCon, SpeechDoneUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppSpeechDoneProcInfo, chan, refCon); }
  434. #else
  435. #define InvokeSpeechDoneUPP(chan, refCon, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppSpeechDoneProcInfo, (chan), (refCon))
  436. #endif
  437. #endif
  438. /*
  439. * InvokeSpeechSyncUPP()
  440. *
  441. * Availability:
  442. * Non-Carbon CFM: available as macro/inline
  443. * CarbonLib: in CarbonLib 1.0.2 and later
  444. * Mac OS X: in version 10.0 and later
  445. */
  446. EXTERN_API_C( void )
  447. InvokeSpeechSyncUPP(
  448. SpeechChannel chan,
  449. long refCon,
  450. OSType syncMessage,
  451. SpeechSyncUPP userUPP);
  452. #if !OPAQUE_UPP_TYPES
  453. #ifdef __cplusplus
  454. inline DEFINE_API_C(void) InvokeSpeechSyncUPP(SpeechChannel chan, long refCon, OSType syncMessage, SpeechSyncUPP userUPP) { CALL_THREE_PARAMETER_UPP(userUPP, uppSpeechSyncProcInfo, chan, refCon, syncMessage); }
  455. #else
  456. #define InvokeSpeechSyncUPP(chan, refCon, syncMessage, userUPP) CALL_THREE_PARAMETER_UPP((userUPP), uppSpeechSyncProcInfo, (chan), (refCon), (syncMessage))
  457. #endif
  458. #endif
  459. /*
  460. * InvokeSpeechErrorUPP()
  461. *
  462. * Availability:
  463. * Non-Carbon CFM: available as macro/inline
  464. * CarbonLib: in CarbonLib 1.0.2 and later
  465. * Mac OS X: in version 10.0 and later
  466. */
  467. EXTERN_API_C( void )
  468. InvokeSpeechErrorUPP(
  469. SpeechChannel chan,
  470. long refCon,
  471. OSErr theError,
  472. long bytePos,
  473. SpeechErrorUPP userUPP);
  474. #if !OPAQUE_UPP_TYPES
  475. #ifdef __cplusplus
  476. inline DEFINE_API_C(void) InvokeSpeechErrorUPP(SpeechChannel chan, long refCon, OSErr theError, long bytePos, SpeechErrorUPP userUPP) { CALL_FOUR_PARAMETER_UPP(userUPP, uppSpeechErrorProcInfo, chan, refCon, theError, bytePos); }
  477. #else
  478. #define InvokeSpeechErrorUPP(chan, refCon, theError, bytePos, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppSpeechErrorProcInfo, (chan), (refCon), (theError), (bytePos))
  479. #endif
  480. #endif
  481. /*
  482. * InvokeSpeechPhonemeUPP()
  483. *
  484. * Availability:
  485. * Non-Carbon CFM: available as macro/inline
  486. * CarbonLib: in CarbonLib 1.0.2 and later
  487. * Mac OS X: in version 10.0 and later
  488. */
  489. EXTERN_API_C( void )
  490. InvokeSpeechPhonemeUPP(
  491. SpeechChannel chan,
  492. long refCon,
  493. short phonemeOpcode,
  494. SpeechPhonemeUPP userUPP);
  495. #if !OPAQUE_UPP_TYPES
  496. #ifdef __cplusplus
  497. inline DEFINE_API_C(void) InvokeSpeechPhonemeUPP(SpeechChannel chan, long refCon, short phonemeOpcode, SpeechPhonemeUPP userUPP) { CALL_THREE_PARAMETER_UPP(userUPP, uppSpeechPhonemeProcInfo, chan, refCon, phonemeOpcode); }
  498. #else
  499. #define InvokeSpeechPhonemeUPP(chan, refCon, phonemeOpcode, userUPP) CALL_THREE_PARAMETER_UPP((userUPP), uppSpeechPhonemeProcInfo, (chan), (refCon), (phonemeOpcode))
  500. #endif
  501. #endif
  502. /*
  503. * InvokeSpeechWordUPP()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: available as macro/inline
  507. * CarbonLib: in CarbonLib 1.0.2 and later
  508. * Mac OS X: in version 10.0 and later
  509. */
  510. EXTERN_API_C( void )
  511. InvokeSpeechWordUPP(
  512. SpeechChannel chan,
  513. long refCon,
  514. unsigned long wordPos,
  515. unsigned short wordLen,
  516. SpeechWordUPP userUPP);
  517. #if !OPAQUE_UPP_TYPES
  518. #ifdef __cplusplus
  519. inline DEFINE_API_C(void) InvokeSpeechWordUPP(SpeechChannel chan, long refCon, unsigned long wordPos, unsigned short wordLen, SpeechWordUPP userUPP) { CALL_FOUR_PARAMETER_UPP(userUPP, uppSpeechWordProcInfo, chan, refCon, wordPos, wordLen); }
  520. #else
  521. #define InvokeSpeechWordUPP(chan, refCon, wordPos, wordLen, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppSpeechWordProcInfo, (chan), (refCon), (wordPos), (wordLen))
  522. #endif
  523. #endif
  524. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  525. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  526. #define NewSpeechTextDoneProc(userRoutine) NewSpeechTextDoneUPP(userRoutine)
  527. #define NewSpeechDoneProc(userRoutine) NewSpeechDoneUPP(userRoutine)
  528. #define NewSpeechSyncProc(userRoutine) NewSpeechSyncUPP(userRoutine)
  529. #define NewSpeechErrorProc(userRoutine) NewSpeechErrorUPP(userRoutine)
  530. #define NewSpeechPhonemeProc(userRoutine) NewSpeechPhonemeUPP(userRoutine)
  531. #define NewSpeechWordProc(userRoutine) NewSpeechWordUPP(userRoutine)
  532. #define CallSpeechTextDoneProc(userRoutine, chan, refCon, nextBuf, byteLen, controlFlags) InvokeSpeechTextDoneUPP(chan, refCon, nextBuf, byteLen, controlFlags, userRoutine)
  533. #define CallSpeechDoneProc(userRoutine, chan, refCon) InvokeSpeechDoneUPP(chan, refCon, userRoutine)
  534. #define CallSpeechSyncProc(userRoutine, chan, refCon, syncMessage) InvokeSpeechSyncUPP(chan, refCon, syncMessage, userRoutine)
  535. #define CallSpeechErrorProc(userRoutine, chan, refCon, theError, bytePos) InvokeSpeechErrorUPP(chan, refCon, theError, bytePos, userRoutine)
  536. #define CallSpeechPhonemeProc(userRoutine, chan, refCon, phonemeOpcode) InvokeSpeechPhonemeUPP(chan, refCon, phonemeOpcode, userRoutine)
  537. #define CallSpeechWordProc(userRoutine, chan, refCon, wordPos, wordLen) InvokeSpeechWordUPP(chan, refCon, wordPos, wordLen, userRoutine)
  538. #endif /* CALL_NOT_IN_CARBON */
  539. /*
  540. * SpeechManagerVersion()
  541. *
  542. * Availability:
  543. * Non-Carbon CFM: in SpeechLib 1.0 and later
  544. * CarbonLib: in CarbonLib 1.0 and later
  545. * Mac OS X: in version 10.0 and later
  546. */
  547. EXTERN_API( NumVersion )
  548. SpeechManagerVersion(void) FOURWORDINLINE(0x203C, 0x0000, 0x000C, 0xA800);
  549. /*
  550. * MakeVoiceSpec()
  551. *
  552. * Availability:
  553. * Non-Carbon CFM: in SpeechLib 1.0 and later
  554. * CarbonLib: in CarbonLib 1.0 and later
  555. * Mac OS X: in version 10.0 and later
  556. */
  557. EXTERN_API( OSErr )
  558. MakeVoiceSpec(
  559. OSType creator,
  560. OSType id,
  561. VoiceSpec * voice) FOURWORDINLINE(0x203C, 0x0604, 0x000C, 0xA800);
  562. /*
  563. * CountVoices()
  564. *
  565. * Availability:
  566. * Non-Carbon CFM: in SpeechLib 1.0 and later
  567. * CarbonLib: in CarbonLib 1.0 and later
  568. * Mac OS X: in version 10.0 and later
  569. */
  570. EXTERN_API( OSErr )
  571. CountVoices(short * numVoices) FOURWORDINLINE(0x203C, 0x0108, 0x000C, 0xA800);
  572. /*
  573. * GetIndVoice()
  574. *
  575. * Availability:
  576. * Non-Carbon CFM: in SpeechLib 1.0 and later
  577. * CarbonLib: in CarbonLib 1.0 and later
  578. * Mac OS X: in version 10.0 and later
  579. */
  580. EXTERN_API( OSErr )
  581. GetIndVoice(
  582. short index,
  583. VoiceSpec * voice) FOURWORDINLINE(0x203C, 0x030C, 0x000C, 0xA800);
  584. /*
  585. * GetVoiceDescription()
  586. *
  587. * Availability:
  588. * Non-Carbon CFM: in SpeechLib 1.0 and later
  589. * CarbonLib: in CarbonLib 1.0 and later
  590. * Mac OS X: in version 10.0 and later
  591. */
  592. EXTERN_API( OSErr )
  593. GetVoiceDescription(
  594. const VoiceSpec * voice,
  595. VoiceDescription * info,
  596. long infoLength) FOURWORDINLINE(0x203C, 0x0610, 0x000C, 0xA800);
  597. /*
  598. * GetVoiceInfo()
  599. *
  600. * Availability:
  601. * Non-Carbon CFM: in SpeechLib 1.0 and later
  602. * CarbonLib: in CarbonLib 1.0 and later
  603. * Mac OS X: in version 10.0 and later
  604. */
  605. EXTERN_API( OSErr )
  606. GetVoiceInfo(
  607. const VoiceSpec * voice,
  608. OSType selector,
  609. void * voiceInfo) FOURWORDINLINE(0x203C, 0x0614, 0x000C, 0xA800);
  610. /*
  611. * NewSpeechChannel()
  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. EXTERN_API( OSErr )
  619. NewSpeechChannel(
  620. VoiceSpec * voice, /* can be NULL */
  621. SpeechChannel * chan) FOURWORDINLINE(0x203C, 0x0418, 0x000C, 0xA800);
  622. /*
  623. * DisposeSpeechChannel()
  624. *
  625. * Availability:
  626. * Non-Carbon CFM: in SpeechLib 1.0 and later
  627. * CarbonLib: in CarbonLib 1.0 and later
  628. * Mac OS X: in version 10.0 and later
  629. */
  630. EXTERN_API( OSErr )
  631. DisposeSpeechChannel(SpeechChannel chan) FOURWORDINLINE(0x203C, 0x021C, 0x000C, 0xA800);
  632. /*
  633. * SpeakString()
  634. *
  635. * Availability:
  636. * Non-Carbon CFM: in SpeechLib 1.0 and later
  637. * CarbonLib: in CarbonLib 1.0 and later
  638. * Mac OS X: in version 10.0 and later
  639. */
  640. EXTERN_API( OSErr )
  641. SpeakString(ConstStr255Param textToBeSpoken) FOURWORDINLINE(0x203C, 0x0220, 0x000C, 0xA800);
  642. /*
  643. * SpeakText()
  644. *
  645. * Availability:
  646. * Non-Carbon CFM: in SpeechLib 1.0 and later
  647. * CarbonLib: in CarbonLib 1.0 and later
  648. * Mac OS X: in version 10.0 and later
  649. */
  650. EXTERN_API( OSErr )
  651. SpeakText(
  652. SpeechChannel chan,
  653. const void * textBuf,
  654. unsigned long textBytes) FOURWORDINLINE(0x203C, 0x0624, 0x000C, 0xA800);
  655. /*
  656. * SpeakBuffer()
  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. EXTERN_API( OSErr )
  664. SpeakBuffer(
  665. SpeechChannel chan,
  666. const void * textBuf,
  667. unsigned long textBytes,
  668. long controlFlags) FOURWORDINLINE(0x203C, 0x0828, 0x000C, 0xA800);
  669. /*
  670. * StopSpeech()
  671. *
  672. * Availability:
  673. * Non-Carbon CFM: in SpeechLib 1.0 and later
  674. * CarbonLib: in CarbonLib 1.0 and later
  675. * Mac OS X: in version 10.0 and later
  676. */
  677. EXTERN_API( OSErr )
  678. StopSpeech(SpeechChannel chan) FOURWORDINLINE(0x203C, 0x022C, 0x000C, 0xA800);
  679. /*
  680. * StopSpeechAt()
  681. *
  682. * Availability:
  683. * Non-Carbon CFM: in SpeechLib 1.0 and later
  684. * CarbonLib: in CarbonLib 1.0 and later
  685. * Mac OS X: in version 10.0 and later
  686. */
  687. EXTERN_API( OSErr )
  688. StopSpeechAt(
  689. SpeechChannel chan,
  690. long whereToStop) FOURWORDINLINE(0x203C, 0x0430, 0x000C, 0xA800);
  691. /*
  692. * PauseSpeechAt()
  693. *
  694. * Availability:
  695. * Non-Carbon CFM: in SpeechLib 1.0 and later
  696. * CarbonLib: in CarbonLib 1.0 and later
  697. * Mac OS X: in version 10.0 and later
  698. */
  699. EXTERN_API( OSErr )
  700. PauseSpeechAt(
  701. SpeechChannel chan,
  702. long whereToPause) FOURWORDINLINE(0x203C, 0x0434, 0x000C, 0xA800);
  703. /*
  704. * ContinueSpeech()
  705. *
  706. * Availability:
  707. * Non-Carbon CFM: in SpeechLib 1.0 and later
  708. * CarbonLib: in CarbonLib 1.0 and later
  709. * Mac OS X: in version 10.0 and later
  710. */
  711. EXTERN_API( OSErr )
  712. ContinueSpeech(SpeechChannel chan) FOURWORDINLINE(0x203C, 0x0238, 0x000C, 0xA800);
  713. /*
  714. * SpeechBusy()
  715. *
  716. * Availability:
  717. * Non-Carbon CFM: in SpeechLib 1.0 and later
  718. * CarbonLib: in CarbonLib 1.0 and later
  719. * Mac OS X: in version 10.0 and later
  720. */
  721. EXTERN_API( short )
  722. SpeechBusy(void) FOURWORDINLINE(0x203C, 0x003C, 0x000C, 0xA800);
  723. /*
  724. * SpeechBusySystemWide()
  725. *
  726. * Availability:
  727. * Non-Carbon CFM: in SpeechLib 1.0 and later
  728. * CarbonLib: in CarbonLib 1.0 and later
  729. * Mac OS X: in version 10.0 and later
  730. */
  731. EXTERN_API( short )
  732. SpeechBusySystemWide(void) FOURWORDINLINE(0x203C, 0x0040, 0x000C, 0xA800);
  733. /*
  734. * SetSpeechRate()
  735. *
  736. * Availability:
  737. * Non-Carbon CFM: in SpeechLib 1.0 and later
  738. * CarbonLib: in CarbonLib 1.0 and later
  739. * Mac OS X: in version 10.0 and later
  740. */
  741. EXTERN_API( OSErr )
  742. SetSpeechRate(
  743. SpeechChannel chan,
  744. Fixed rate) FOURWORDINLINE(0x203C, 0x0444, 0x000C, 0xA800);
  745. /*
  746. * GetSpeechRate()
  747. *
  748. * Availability:
  749. * Non-Carbon CFM: in SpeechLib 1.0 and later
  750. * CarbonLib: in CarbonLib 1.0 and later
  751. * Mac OS X: in version 10.0 and later
  752. */
  753. EXTERN_API( OSErr )
  754. GetSpeechRate(
  755. SpeechChannel chan,
  756. Fixed * rate) FOURWORDINLINE(0x203C, 0x0448, 0x000C, 0xA800);
  757. /*
  758. * SetSpeechPitch()
  759. *
  760. * Availability:
  761. * Non-Carbon CFM: in SpeechLib 1.0 and later
  762. * CarbonLib: in CarbonLib 1.0 and later
  763. * Mac OS X: in version 10.0 and later
  764. */
  765. EXTERN_API( OSErr )
  766. SetSpeechPitch(
  767. SpeechChannel chan,
  768. Fixed pitch) FOURWORDINLINE(0x203C, 0x044C, 0x000C, 0xA800);
  769. /*
  770. * GetSpeechPitch()
  771. *
  772. * Availability:
  773. * Non-Carbon CFM: in SpeechLib 1.0 and later
  774. * CarbonLib: in CarbonLib 1.0 and later
  775. * Mac OS X: in version 10.0 and later
  776. */
  777. EXTERN_API( OSErr )
  778. GetSpeechPitch(
  779. SpeechChannel chan,
  780. Fixed * pitch) FOURWORDINLINE(0x203C, 0x0450, 0x000C, 0xA800);
  781. /*
  782. * SetSpeechInfo()
  783. *
  784. * Availability:
  785. * Non-Carbon CFM: in SpeechLib 1.0 and later
  786. * CarbonLib: in CarbonLib 1.0 and later
  787. * Mac OS X: in version 10.0 and later
  788. */
  789. EXTERN_API( OSErr )
  790. SetSpeechInfo(
  791. SpeechChannel chan,
  792. OSType selector,
  793. const void * speechInfo) FOURWORDINLINE(0x203C, 0x0654, 0x000C, 0xA800);
  794. /*
  795. * GetSpeechInfo()
  796. *
  797. * Availability:
  798. * Non-Carbon CFM: in SpeechLib 1.0 and later
  799. * CarbonLib: in CarbonLib 1.0 and later
  800. * Mac OS X: in version 10.0 and later
  801. */
  802. EXTERN_API( OSErr )
  803. GetSpeechInfo(
  804. SpeechChannel chan,
  805. OSType selector,
  806. void * speechInfo) FOURWORDINLINE(0x203C, 0x0658, 0x000C, 0xA800);
  807. /*
  808. * TextToPhonemes()
  809. *
  810. * Availability:
  811. * Non-Carbon CFM: in SpeechLib 1.0 and later
  812. * CarbonLib: in CarbonLib 1.0 and later
  813. * Mac OS X: in version 10.0 and later
  814. */
  815. EXTERN_API( OSErr )
  816. TextToPhonemes(
  817. SpeechChannel chan,
  818. const void * textBuf,
  819. unsigned long textBytes,
  820. Handle phonemeBuf,
  821. long * phonemeBytes) FOURWORDINLINE(0x203C, 0x0A5C, 0x000C, 0xA800);
  822. /*
  823. * UseDictionary()
  824. *
  825. * Availability:
  826. * Non-Carbon CFM: in SpeechLib 1.0 and later
  827. * CarbonLib: in CarbonLib 1.0 and later
  828. * Mac OS X: in version 10.0 and later
  829. */
  830. EXTERN_API( OSErr )
  831. UseDictionary(
  832. SpeechChannel chan,
  833. Handle dictionary) FOURWORDINLINE(0x203C, 0x0460, 0x000C, 0xA800);
  834. #if PRAGMA_STRUCT_ALIGN
  835. #pragma options align=reset
  836. #elif PRAGMA_STRUCT_PACKPUSH
  837. #pragma pack(pop)
  838. #elif PRAGMA_STRUCT_PACK
  839. #pragma pack()
  840. #endif
  841. #ifdef PRAGMA_IMPORT_OFF
  842. #pragma import off
  843. #elif PRAGMA_IMPORT
  844. #pragma import reset
  845. #endif
  846. #ifdef __cplusplus
  847. }
  848. #endif
  849. #endif /* __SPEECHSYNTHESIS__ */