toolvox.h 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. /*****************************************************************************
  2. Module ToolVox.H
  3. The defines and prototypes for the Voxware voice compression
  4. system.
  5. Version 1.1.8.192
  6. For MacOS, Windows 3.1, Windows95, and Solaris
  7. Voxware Inc.
  8. 305 College Road East
  9. Princeton, New Jersey 08540
  10. http://www.voxware.com
  11. Voxware Proprietary Material
  12. Copyright 1996, Voxware, Inc.
  13. All Rights Resrved
  14. DISTRIBUTION PROHIBITED without written authorization from Voxware
  15. *****************************************************************************/
  16. /*
  17. !!! All reserved, padding, and optional fields should be set to zero if
  18. !!! you are not using them. Please memset() all structures before using
  19. !!! them.
  20. */
  21. /*
  22. You must "#define VOXWARE_xxx" for the environment you
  23. are generating code for.
  24. Valid types are:
  25. VOXWARE_WIN16 <-- Windows 3.x
  26. VOXWARE_WIN32 <-- Windows 95 or Windows NT
  27. VOXWARE_DOS <-- MS-DOS
  28. VOXWARE_MAC <-- MacOS
  29. VOXWARE_SUN <-- SunOS/Solaris
  30. VOXWARE_HP <-- HPUX (Version 9.xx)
  31. VOXWARE_AIX <-- IBM's AIX
  32. */
  33. #ifndef __TOOLVOX_H_
  34. #define __TOOLVOX_H_
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. #ifndef VOXWARE_SUN
  39. #ifdef VOXWARE_MAC
  40. #include <ConditionalMacros.h>
  41. #endif
  42. #if PRAGMA_ALIGN_SUPPORTED
  43. #pragma options align=mac68k
  44. #elif VOXWARE_HP
  45. #pragma HP_ALIGN HPUX_WORD
  46. #else
  47. #pragma pack(2)
  48. #endif
  49. #endif
  50. // DAVE: THIS SHOULD PROBABLY BE IN THIS FILE INSTEAD OF ITS OWN HDR. -GEO
  51. #include "voxchunk.h"
  52. /* Value returned from a ToolVox function call. See ToolVox manual for a */
  53. /* list of specific return codes for each function. */
  54. typedef unsigned short VOXWARE_RETCODE;
  55. /* We support VOXWARE_WIN for backwards compatibility. Use VOXWARE_WIN16. */
  56. #if defined (VOXWARE_WIN)
  57. #define VOXWARE_WIN16
  58. #endif
  59. #if defined (VOXWARE_WIN16)
  60. #define VOX_FAR __far
  61. #define VOX_EXPORT __export
  62. #define VOX_PASCAL __pascal
  63. #define VOXAPI VOX_FAR VOX_PASCAL
  64. #ifdef __cplusplus
  65. #define VOXAPI_CALLBACK VOX_FAR __pascal
  66. #else
  67. #define VOXAPI_CALLBACK VOX_FAR __pascal __loadds
  68. #endif
  69. #elif defined(VOXWARE_WIN32)
  70. #define VOX_FAR
  71. #define VOX_EXPORT
  72. #define VOX_PASCAL __stdcall
  73. #define VOXAPI VOX_PASCAL
  74. #define VOXAPI_CALLBACK __stdcall
  75. #elif defined(VOXWARE_MAC)
  76. #define VOX_FAR
  77. #define VOX_EXPORT
  78. #define VOX_PASCAL pascal
  79. #define VOXAPI VOX_PASCAL
  80. #define VOXAPI_CALLBACK VOX_PASCAL
  81. #elif defined(VOXWARE_SUN)
  82. #if defined(VOXWARE_SGI) || defined(VOXWARE_DEC)
  83. #define VOX_FAR
  84. #define VOX_EXPORT
  85. #define VOX_PASCAL
  86. #define VOXAPI
  87. #define VOXAPI_CALLBACK short
  88. #else
  89. #define VOX_FAR
  90. #define VOX_EXPORT
  91. #define VOX_PASCAL
  92. #define VOXAPI
  93. #define VOXAPI_CALLBACK
  94. #endif
  95. #elif defined(VOXWARE_DOS)
  96. #define VOX_FAR __far
  97. #define VOX_EXPORT
  98. #define VOX_PASCAL pascal
  99. #define VOXAPI VOX_PASCAL
  100. #define VOXAPI_CALLBACK VOX_PASCAL
  101. #else
  102. #pragma message ("TOOLVOX.H: Platform indicator #define not setup.")
  103. #pragma message ("TOOLVOX.H: One of the following must be initialized:")
  104. #pragma message ("TOOLVOX.H: #define VOXWARE_WIN16")
  105. #pragma message ("TOOLVOX.H: #define VOXWARE_WIN32")
  106. #pragma message ("TOOLVOX.H: #define VOXWARE_MAC")
  107. #pragma message ("TOOLVOX.H: #define VOXWARE_SUN")
  108. #pragma message ("TOOLVOX.H: #define VOXWARE_DOS")
  109. #pragma message ("TOOLVOX.H: Check the Voxware manual for more information.")
  110. #endif
  111. /*****************************************************************************
  112. ** **
  113. ** The data structures that will be passed to the ToolVox functions. **
  114. ** **
  115. *****************************************************************************/
  116. typedef struct tagVOX_ENVIRONMENT
  117. {
  118. unsigned short wSizeofVoxEnvironment; /* --> Fill this in for us */
  119. unsigned short wCompatibility; /* <-- versioning */
  120. unsigned long dwAPIVersionNumber; /* <-- Version of API */
  121. unsigned long dwAPIMaintanceNumber; /* <-- Maint Rel of API */
  122. unsigned short wNumCodecs; /* <-- Number of CODECS avail. */
  123. unsigned short wNumVoiceFonts; /* <-- Number of VoiceFonts */
  124. char szAPIName[32]; /* <-- ToolVox For MacOS 1.1.5 */
  125. } VOX_ENVIRONMENT;
  126. typedef VOX_ENVIRONMENT VOX_FAR * LPVOX_ENVIRONMENT;
  127. typedef struct tagVOXWARE_DATA
  128. {
  129. unsigned short wSizeOfVoxwareData; /* The size of this structure */
  130. unsigned short wUserData; /* Application dependent data */
  131. /* ...(16 bit). */
  132. unsigned long dwUserData; /* Application dependent data */
  133. /* (32 bit). */
  134. /* Buffer information required for (de)compressing between buffers <-> */
  135. /* disk. */
  136. unsigned long dwInputType; /* What is stored in the */
  137. /* ...'lpInputLocation' field. */
  138. void VOX_FAR *lpInputLocation; /* Pointer to a filename or */
  139. /* ...buffer. */
  140. unsigned long dwInputSize; /* Inform Voxware about the */
  141. /* ...buffer size. */
  142. unsigned long dwInputPosition; /* Input data offset info. */
  143. unsigned long dwInputSamplingRate; /* Number of samples per second.*/
  144. unsigned short wInputBytesPerSample; /* Number of bytes per sample. */
  145. unsigned long dwOutputType; /* What is stored in the */
  146. /* ...'lpOutputLocation' field. */
  147. void VOX_FAR *lpOutputLocation; /* Pointer to filename, buffer, */
  148. /* ...or empty for playback. */
  149. unsigned long dwOutputSize; /* Inform Voxware about the */
  150. /* ...buffer size. */
  151. unsigned long dwOutputPosition; /* Output data offset info. */
  152. unsigned long dwOutputSamplingRate; /* Number of samples per second.*/
  153. unsigned short wOutputBytesPerSample;/* Number of bytes per sample. */
  154. /* The decompression routines will use the following for voice effects: */
  155. unsigned short bUseAbsolutePitchFlag;/* TRUE if fPitchChange is to */
  156. /* ...be used; FALSE is for */
  157. /* ...fPitchShift usage. */
  158. float fRelativePitch; /* Relative PitchShift factor. */
  159. float fAbsolutePitch; /* Absolute PitchShift value. */
  160. float fWarpedLengthFactor; /* Warping factor */
  161. /* ...0.2<factor<5.0 (a value */
  162. /* ...of 1.0 = normal time) */
  163. void VOX_FAR *lpVoiceFont; /* VoiceFont used for playback. */
  164. unsigned long dwVoiceFontEnum; /* Data used for enumeration of */
  165. /* ...VoiceFonts. */
  166. /* This is a more detailed value that can help track down errors. */
  167. signed long dwSecondaryReturnCode;
  168. unsigned long dwDataLeft; /* Amount of data to process. */
  169. /* A callback function that the effects routines will call. */
  170. void VOX_FAR *lpCallbackFunc;
  171. void VOX_FAR *lpvControlBlock; /* Private control block used */
  172. /* ...by Voxware. */
  173. /* New fields for ToolVox version 1.1.0. */
  174. unsigned long dwCompressionSettings;/* Choose the compression codec.*/
  175. unsigned long dwStatus; /* Status of ToolVox engine. */
  176. unsigned short wVoiceFontType; /* Unused. Set to zero. */
  177. unsigned short bUseAbsoluteGainFlag; /* true if fGainControl is used */
  178. float fRelativeGain; /* decompression only */
  179. /* Multimedia Codecs Only */
  180. /* 1.0 is normal */
  181. /* greater than 1 is louder */
  182. /* less than 1 is softer */
  183. float fAbsoluteGain; /* decompression only */
  184. signed short wCurrentEnergyLevel; /* 0..255; > 200 = clipping */
  185. unsigned short padding3; /* Unused. Set to zero. */
  186. void VOX_FAR *lpReservedFunction; /* reserved 1 */
  187. void VOX_FAR *lpReservedVars; /* reserved 2 */
  188. void VOX_FAR *lpMarkerRecord; /* reserved */
  189. //###GTT - Added support for communication of info chunks - 5/30/96
  190. VOX_CHUNK_INFO VOX_FAR *lpInfoChunks;
  191. short wNumInfoChunks;
  192. short bV1Compatible;
  193. unsigned short wVoiceFontID; /* Used to activate a VoiceFont */
  194. void VOX_FAR * lpPlaybackWindow;
  195. unsigned short wNumBitsPerFrame;
  196. } VOXWARE_DATA;
  197. typedef VOXWARE_DATA VOX_FAR * LPVOXWARE_DATA;
  198. typedef struct tagVOX_VERSION
  199. {
  200. /* The version and internal name for the ToolVox Compression DLL. */
  201. unsigned char szCompressVersion[64];
  202. unsigned char szCompressInternal[32];
  203. /* The version and maintenance for the ToolVox Compression DLL. */
  204. /* For example: 1.30.46.01 */
  205. unsigned long dwCompressVersion; /* e.g. 0x00010030 = "01.30" */
  206. unsigned long dwCompressMaint; /* e.g. 0x00460001 = "46.01" */
  207. /* The version and internal name for the ToolVox Decompression DLL. */
  208. unsigned char szDecompressVersion[64];
  209. unsigned char szDecompressInternal[32];
  210. /* The version and maintenance for the ToolVox Decompression DLL. */
  211. /* For example: 1.30.46.01 */
  212. unsigned long dwDecompressVersion; /* e.g. 0x00010030 = "01.30" */
  213. unsigned long dwDecompressMaint; /* e.g. 0x00460001 = "46.01" */
  214. /* The version and internal name for the ToolVox VoiceFont DLL. */
  215. unsigned char szVoiceFontVersion[64];
  216. unsigned char szVoiceFontInternal[32];
  217. /* The version and maintenance for the ToolVox VoiceFont DLL. */
  218. /* For example: 1.30.46.01 */
  219. unsigned long dwVoiceFontVersion; /* e.g. 0x00010030 = "01.30" */
  220. unsigned long dwVoiceFontMaint; /* e.g. 0x00460001 = "46.01" */
  221. /* The version and internal name for the ToolVox Utility DLL. */
  222. unsigned char szUtilityVersion[64];
  223. unsigned char szUtilityInternal[32];
  224. /* The version and maintenance for the ToolVox Utility DLL. */
  225. /* For example: 1.30.46.01 */
  226. unsigned long dwUtilityVersion; /* e.g. 0x00010030 = "01.30" */
  227. unsigned long dwUtilityMaint; /* e.g. 0x00460001 = "46.01" */
  228. /* The version and internal name for the ToolVox RT24 Compression DLL. */
  229. unsigned char szRT24CompressVersion[64];
  230. unsigned char szRT24CompressInternal[32];
  231. /* The version and maintenance for the ToolVox RT24 Compression DLL. */
  232. /* For example: 1.30.46.01 */
  233. unsigned long dwRT24CompressVersion; /* e.g. 0x00010030 = "01.30" */
  234. unsigned long dwRT24CompressMaint; /* e.g. 0x00460001 = "46.01" */
  235. /* The version and internal name for the ToolVox RT24 Decompression DLL.*/
  236. unsigned char szRT24DecompressVersion[64];
  237. unsigned char szRT24DecompressInternal[32];
  238. /* The version and maintenance for the ToolVox RT24 Decompression DLL. */
  239. /* For example: 1.30.46.01 */
  240. unsigned long dwRT24DecompressVersion; /* e.g. 0x00010030 = "01.30" */
  241. unsigned long dwRT24DecompressMaint; /* e.g. 0x00460001 = "46.01" */
  242. } VOX_VERSION;
  243. typedef VOX_VERSION VOX_FAR * LPVOX_VERSION;
  244. typedef struct tagVOX_FILE_INFO
  245. {
  246. /* Some standard WAV, AIFF, and VOX file data. */
  247. unsigned short wFormatTag; /* WAVE_FORMAT_VOXWARE for com- */
  248. /* ...pressed or WAVE_FORMAT_PCM */
  249. /* ...for standard files. */
  250. unsigned short nChannels; /* Set to the value */
  251. /* ...VOXWARE_WAVE_FILE_MONO or */
  252. /* ...VOXWARE_WAVE_FILE_STEREO. */
  253. unsigned long nAvgBitsPerSec; /* The bit rate of this file. */
  254. unsigned long dwSamplingRate;
  255. unsigned short wBytesPerSample;
  256. unsigned long dwNumSamplesInFile; /* The total number of samples in */
  257. /* ...the file. */
  258. float fMeanPitch; /* Weighted average pitch of the */
  259. /* ...Vox file. */
  260. float fMinPitch; /* Lowest pitch value of the file. */
  261. float fMaxPitch; /* Highest pitch value of the file. */
  262. //###lee - split this out into a new structure:
  263. unsigned long dwCompressedSize; /* One is estimated, and the other */
  264. unsigned long dwDecompressedSize; /* ...is the current size. */
  265. unsigned short bVariableRate; /* TRUE if codec is variable rate. */
  266. } VOX_FILE_INFO;
  267. typedef VOX_FILE_INFO VOX_FAR * LPVOX_FILE_INFO;
  268. typedef struct tagVFONT_IDENTIFIER
  269. {
  270. /* Used for vfontEnumerate calls. */
  271. char szFontName[32];
  272. char szFontFile[128];
  273. } VFONT_IDENTIFIER;
  274. typedef VFONT_IDENTIFIER VOX_FAR * LPVFONT_IDENTIFIER;
  275. typedef struct tagCODEC_DESCRIPTION
  276. {
  277. unsigned long dwCodecID;
  278. char szCodecInternalName[44];
  279. char szCodecListBoxName[44];
  280. char szCodecDescription[256];
  281. } CODEC_DESCRIPTION;
  282. typedef CODEC_DESCRIPTION VOX_FAR * LPCODEC_DESCRIPTION;
  283. typedef struct tagVOICE_FONT_DESCRIPTION
  284. {
  285. unsigned short wFontID;
  286. char szFontFamily[44];
  287. char szFontName[44];
  288. char szFontDescription[256];
  289. unsigned short bHasDecodeEffect;
  290. unsigned short wSizeofDecodeChunk;
  291. } VOICE_FONT_DESCRIPTION;
  292. typedef VOICE_FONT_DESCRIPTION VOX_FAR * LPVOICE_FONT_DESCRIPTION;
  293. typedef struct tagVOX_FUNCTION_VARS
  294. {
  295. unsigned short wSizeOfFunctionVars; /* The size of this structure */
  296. void VOX_FAR *lpBuffer; /* Pointer to a the data buffer.*/
  297. unsigned long dwBufferSize; /* The size of the buffer. */
  298. unsigned long dwUserData; /* Application dependent data */
  299. /* (32 bit). */
  300. LPVOXWARE_DATA lpVoxwareData; /* The original VoxawareData */
  301. /* used to start processing. */
  302. } VOX_FUNCTION_VARS;
  303. typedef VOX_FUNCTION_VARS VOX_FAR * LPVOX_FUNCTION_VARS;
  304. /*
  305. For use with BitStreams
  306. */
  307. typedef struct tagVOX_STREAM_HEADER
  308. {
  309. unsigned long dwHeaderID;
  310. unsigned short wSizeOfVoxStreamHeader;
  311. unsigned char voxStreamHeaderData[1]; // variable length
  312. } VOX_STREAM_HEADER;
  313. typedef VOX_STREAM_HEADER VOX_FAR * LPVOX_STREAM_HEADER;
  314. typedef struct tagFIRST_BITSTREAM_BUFFER
  315. {
  316. unsigned short wSizeOfFirstBitStreamStruct;
  317. unsigned short wNumBitsPerFrame;
  318. unsigned short wNumSamplesPerFrame;
  319. unsigned short wPadding;
  320. VOX_STREAM_HEADER voxStreamHeader; /* Send this to the decoder */
  321. } FIRST_BITSTREAM_BUFFER;
  322. typedef FIRST_BITSTREAM_BUFFER VOX_FAR * LPFIRST_BITSTREAM_BUFFER;
  323. /*
  324. VOX_CALLBACK is a typedef for the user function that is called by the
  325. ToolVox compression and decompression routines.
  326. Special Note for Macintosh Developers:
  327. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  328. Do >> NOT << give us a Universal Procedure Pointer.
  329. We make our own so you don't have to... (your welcome)
  330. Sooo just give us the functions name:
  331. yourVoxData->lpCallbackFunc = myCallbackProc;
  332. */
  333. #ifdef VOXWARE_MAC
  334. typedef VOXAPI_CALLBACK VOXWARE_RETCODE (* VOX_CALLBACK)
  335. (unsigned short wVox, unsigned short wMessage,
  336. LPVOXWARE_DATA lpVoxData);
  337. #else
  338. #if defined(VOXWARE_SGI) || defined(VOXWARE_DEC)
  339. typedef VOXWARE_RETCODE ( * VOX_CALLBACK) (unsigned short , unsigned short , LPVOXWARE_DATA );
  340. #else
  341. typedef VOXWARE_RETCODE (VOXAPI_CALLBACK * VOX_CALLBACK)
  342. (unsigned short wVox, unsigned short wMessage,
  343. LPVOXWARE_DATA lpVoxData);
  344. #endif
  345. #endif
  346. typedef struct tagVOX_COMMAND
  347. {
  348. unsigned long dwAttribute; /* Attribute to act on? */
  349. float fFloatParam; /* Use this for float attributes. */
  350. unsigned long dwLongParam; /* Use this for long attributes. */
  351. } VOX_COMMAND;
  352. typedef VOX_COMMAND VOX_FAR * LPVOX_COMMAND;
  353. #define ATTRIBUTE_WARPED_LENGTH_FACTOR 1L // get and set
  354. #define ATTRIBUTE_RELATIVE_PITCH 2L // get and set
  355. #define ATTRIBUTE_ABSOLUTE_PITCH 3L // get and set
  356. #define ATTRIBUTE_PLAY_TIME 5L // not yet supported
  357. #define ATTRIBUTE_VOICE_FONT 6L // set only
  358. #define ATTRIBUTE_GAIN_CONTROL 7L // get and set
  359. #define ATTRIBUTE_BITS_PER_SECOND 8L // not yet supported
  360. #define ATTRIBUTE_FIXED_RATE_CODEC 9L // not yet supported
  361. #define ATTRIBUTE_DUMP_BUFFERS 0x80000 + 1L // RESERVED: bit bit offset is param
  362. #define ATTRIBUTE_SILENT_WINDOW 0x80000 + 2L // RESERVED: get set dwLongParam = WORD ms
  363. #define ATTRIBUTE_INDICATE_LOST_FRAME 0x80000 + 3L // RESERVED: set dwLongParam = BOOL
  364. #define ATTRIBUTE_VOICE_LEVEL 0x80000 + 4L // RESERVED: get set dwLongParam = WORD Value
  365. #define ATTRIBUTE_VOICE_STATE 0x80000 + 5L // RESERVED: get dwLongParam = int Value
  366. //#define ATTRIBUTE_VOICE_FONT_II 0x80000 + 6L // RESERVED: set dwLongParam = short EffectSelection - fFloatParam = short SliderValue
  367. //#define ATTRIBUTE_VOICE_EFFECT 0x80000 + 7L // RESERVED: set dwLongParam = short EffectSelection - fFloatParam = short SliderValue
  368. #define ATTRIBUTE_BIT_OFFSET 0x80000 + 8L // RESERVED: set
  369. #define ATTRIBUTE_GAIN_CONTROL_ADJUST 0x80000 + 6L // RESERVED: get dwLongParam = signed short Value
  370. #define ATTRIBUTE_AGC_REFERENCE_LEVEL 0x80000 + 7L // RESERVED: set dwLongParam = unsigned short Value
  371. /*****************************************************************************
  372. **
  373. ** lpVoxwareData->dwCompressionSettings = VOXWARE_CODEC_xxx
  374. **
  375. ** Not filling in the dwCompressionSettings field, or setting it to default
  376. ** tells ToolVox to compress what you gave it using the best codec for the
  377. ** job. If you give us a 11k-16k file, we will chose the MM_11k codec, if
  378. ** you give us a 22k or better file, we will choose the MM_22k codec, etc...
  379. **
  380. ** If you assign one of the values below to the dwCompressionSettings field,
  381. ** then we will send your file through the codec you asked us to.
  382. **
  383. ** Refer to page ###Maija: of the manual for more.
  384. **
  385. *****************************************************************************/
  386. #define VOXWARE_CODEC_RT_8K 0x01000001
  387. #define VOXWARE_CODEC_RT_8K_HQ29 0x01000010
  388. #define VOXWARE_CODEC_RT_8K_HQ24 0x01000004 // Do not use - unavailable for this release.
  389. #define VOXWARE_CODEC_RT_8K_VR12 0x01000008 // Do not use - unavailable for this release.
  390. #define VOXWARE_CODEC_RT_8K_VR15 0x01000009 // Do not use - unavailable for this release.
  391. #define VOXWARE_CODEC_RT_8K_UQ 0x0100000C // Do not use - unavailable for this release.
  392. #define VOXWARE_CODEC_MM_11K 0x02000002 // Do not use - unavailable for this release.
  393. #define VOXWARE_CODEC_MM_22K 0x04000002 // Do not use - unavailable for this release.
  394. #define VOXWARE_CODEC_DEFAULT 0x00000000
  395. #define VOXWARE_CODEC_RT24 VOXWARE_CODEC_RT_8K // obs spelling
  396. /*Add for AUDIO codec*/
  397. #define VOXWARE_CODEC_AC_8K 0X08000001
  398. #define VOXWARE_CODEC_AC_11K 0X08000002
  399. #define VOXWARE_CODEC_AC_16K 0X08000003
  400. #define VOXWARE_CODEC_AC_22K 0X08000004
  401. /* These are provided for backwards compatibility The #define's above should be used. */
  402. #define VOXWARE_AUDIO_CODEC_08 VOXWARE_CODEC_AC_8K
  403. #define VOXWARE_AUDIO_CODEC_11 VOXWARE_CODEC_AC_11K
  404. #define VOXWARE_AUDIO_CODEC_16 VOXWARE_CODEC_AC_16K
  405. #define VOXWARE_AUDIO_CODEC_22 VOXWARE_CODEC_AC_22K
  406. /*****************************************************************************
  407. **
  408. ** These are used to define the input and output types. They should be ORed
  409. ** together to create the type that is needed. For example compressing
  410. ** a Windows Wave file would use VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FILE.
  411. ** To specify the compressed output Wave file, use: VOXTYPE_FORMAT_WAVE|
  412. ** VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_VOX.
  413. **
  414. *****************************************************************************/
  415. //#define VOXTYPE_FORMAT_IRRELEVENT (unsigned long)(0x00000000L)
  416. #define VOXTYPE_FORMAT_WAVE (unsigned long)(0x00010000L)
  417. #define VOXTYPE_FORMAT_RAW (unsigned long)(0x00020000L)
  418. #define VOXTYPE_FORMAT_AIFF (unsigned long)(0x00030000L)
  419. #define VOXTYPE_FORMAT_VFONT (unsigned long)(0x00040000L)
  420. #define VOXTYPE_FORMAT_PITCH (unsigned long)(0x00050000L)
  421. #define VOXTYPE_LOCATION_FILE (unsigned long)(0x00000100L)
  422. #define VOXTYPE_LOCATION_BUFFER (unsigned long)(0x00000200L)
  423. #define VOXTYPE_LOCATION_FSSPEC (unsigned long)(0x00000300L)
  424. #define VOXTYPE_LOCATION_SOUND (unsigned long)(0x00000400L)
  425. #define VOXTYPE_LOCATION_FUNCTION (unsigned long)(0x00000800L)
  426. #define VOXTYPE_LOCATION_STRING (unsigned long)(0x00001000L)
  427. #define VOXTYPE_LOCATION_BITSTREAM (unsigned long)(0x00001100L)
  428. #define VOXTYPE_LOCATION_VOICE_FONT_ID (unsigned long)(0x00001200L)
  429. #define VOXTYPE_QUALIFIER_PCM (unsigned long)(0x00000000L)
  430. #define VOXTYPE_QUALIFIER_VOX (unsigned long)(0x00000001L)
  431. #define VOXTYPE_QUALIFIER_PITCH (unsigned long)(0x00000002L)
  432. //#define VOXTYPE_QUALIFIER_ASYNC (unsigned long)(0x00000004L)
  433. #define VOXTYPE_CONST_FILE_INFO (unsigned long)(0x10000000L)
  434. #define VOXTYPE_CONST_VERSION (unsigned long)(0x20000000L)
  435. #define VOXTYPE_CONST_BENCHMARK (unsigned long)(0x40000000L)
  436. #define VOXTYPE_FORMAT_MASK (unsigned long)(0x000F0000L)
  437. #define VOXTYPE_LOCATION_MASK (unsigned long)(0x0000FF00L)
  438. #define VOXTYPE_VFONT_FILENAME (unsigned long)(VOXTYPE_FORMAT_VFONT|VOXTYPE_LOCATION_FILE)
  439. #define VOXTYPE_VFONT_DESCRIPTION (unsigned long)(VOXTYPE_FORMAT_VFONT|VOXTYPE_LOCATION_STRING)
  440. #define VOXTYPE_VFONT_IDENTIFIER (unsigned long)(VOXTYPE_FORMAT_VFONT|VOXTYPE_LOCATION_BUFFER)
  441. /*
  442. The following constants can be used in the dwOutputType and dwInputType
  443. fields of the VoxwareData structure instead of ORing the flags above...
  444. */
  445. #define TYPE_WAVE_PCM_FILE (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_PCM)
  446. #define TYPE_AIFF_PCM_FILE (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_PCM)
  447. #define TYPE_RAW_PCM_FILE (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_PCM)
  448. #define TYPE_WAVE_PCM_FSSPEC (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_PCM)
  449. #define TYPE_AIFF_PCM_FSSPEC (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_PCM)
  450. #define TYPE_RAW_PCM_FSSPEC (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_PCM)
  451. #define TYPE_WAVE_PCM_BUFFER (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_PCM)
  452. #define TYPE_AIFF_PCM_BUFFER (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_PCM)
  453. #define TYPE_RAW_PCM_BUFFER (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_PCM)
  454. #define TYPE_WAVE_PCM_FUNCTION (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_PCM)
  455. #define TYPE_AIFF_PCM_FUNCTION (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_PCM)
  456. #define TYPE_RAW_PCM_FUNCTION (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_PCM)
  457. #define TYPE_WAVE_VOX_FILE (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_VOX)
  458. //#define TYPE_AIFF_VOX_FILE (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_VOX)
  459. #define TYPE_RAW_VOX_FILE (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FILE|VOXTYPE_QUALIFIER_VOX)
  460. #define TYPE_WAVE_VOX_FSSPEC (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_VOX)
  461. //#define TYPE_AIFF_VOX_FSSPEC (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_VOX)
  462. #define TYPE_RAW_VOX_FSSPEC (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FSSPEC|VOXTYPE_QUALIFIER_VOX)
  463. #define TYPE_WAVE_VOX_BUFFER (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_VOX)
  464. #define TYPE_AIFF_VOX_BUFFER (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_VOX)
  465. #define TYPE_RAW_VOX_BUFFER (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_BUFFER|VOXTYPE_QUALIFIER_VOX)
  466. #define TYPE_WAVE_VOX_FUNCTION (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_VOX)
  467. #define TYPE_AIFF_VOX_FUNCTION (unsigned long)(VOXTYPE_FORMAT_AIFF|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_VOX)
  468. #define TYPE_RAW_VOX_FUNCTION (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_FUNCTION|VOXTYPE_QUALIFIER_VOX)
  469. #define TYPE_PLAY_WINMM (unsigned long)(VOXTYPE_LOCATION_SOUND|VOXTYPE_QUALIFIER_PCM)
  470. #define TYPE_PLAY_MAC (unsigned long)(VOXTYPE_LOCATION_SOUND|VOXTYPE_QUALIFIER_PCM)
  471. #define VOXTYPE_RECORD_PCM (unsigned long)(VOXTYPE_LOCATION_SOUND|VOXTYPE_QUALIFIER_PCM) // ###dave 03/25/96: added this
  472. #define TYPE_RAW_VOX_BITSTREAM (unsigned long)(VOXTYPE_FORMAT_RAW|VOXTYPE_LOCATION_BITSTREAM|VOXTYPE_QUALIFIER_VOX)
  473. #define VOX_VOICE_FONT_PREVIEW_ID (unsigned long)(VOXTYPE_FORMAT_WAVE|VOXTYPE_LOCATION_VOICE_FONT_ID|VOXTYPE_QUALIFIER_VOX)
  474. /*****************************************************************************
  475. **
  476. ** Some defines that can be used with the ToolVox routines.
  477. **
  478. *****************************************************************************/
  479. /* This is the maximum filename size that can be used with the ToolVox */
  480. /* routines. Does not include the space for the NULL. */
  481. #define MAX_FILENAMESIZE 255 /* char szFile[MAX_FILENAMESIZE+1]; */
  482. #define WAVE_FORMAT_VOXWARE 0x0062
  483. // ###dave -lee we need to define _WAVE & _AIFF, and friends... (raw)
  484. #define VOXWARE_WAVE_FILE_MONO 1
  485. #define VOXWARE_WAVE_FILE_STEREO 2
  486. #define VOXWARE_SAMPLING_RATE_8K 8000L
  487. #define VOXWARE_SAMPLING_RATE_11K 11025L
  488. #define VOXWARE_SAMPLING_RATE_11127K 0x2B7745D1L /*11127.27273 khz */
  489. #define VOXWARE_SAMPLING_RATE_16K 16000L
  490. #define VOXWARE_SAMPLING_RATE_22K 22050L
  491. #define VOXWARE_SAMPLING_RATE_22254K 0x56EE8BA3L /*22254.54545 khz */
  492. #define VOXWARE_SAMPLING_RATE_32K 32000L
  493. #define VOXWARE_SAMPLING_RATE_44K 44100L
  494. #define VOXWARE_SAMPLING_INDEX_8K 0
  495. #define VOXWARE_SAMPLING_INDEX_11k 1
  496. #define VOXWARE_SAMPLING_INDEX_16K 2
  497. #define VOXWARE_SAMPLING_INDEX_22K 3
  498. #define VOXWARE_SAMPLING_INDEX_32K 4
  499. #define VOXWARE_SAMPLING_INDEX_44K 5
  500. #define VOXWARE_SAMPLING_INDEX_11127K 6
  501. #define VOXWARE_SAMPLING_INDEX_22254K 7
  502. #define VOXWARE_SAMPLING_INDEX_END (VOXWARE_SAMPLING_INDEX_22254K+1)
  503. #define VOXWARE_NUM_SAMPLING_RATES (VOXWARE_SAMPLING_INDEX_22254K+1)
  504. #define VOXWARE_SAMPLING_RATE_ARRAY {VOXWARE_SAMPLING_RATE_8K, \
  505. VOXWARE_SAMPLING_RATE_11K, \
  506. VOXWARE_SAMPLING_RATE_16K, \
  507. VOXWARE_SAMPLING_RATE_22K, \
  508. VOXWARE_SAMPLING_RATE_32K, \
  509. VOXWARE_SAMPLING_RATE_44K, \
  510. VOXWARE_SAMPLING_RATE_11127K,\
  511. VOXWARE_SAMPLING_RATE_22254K,\
  512. 0L}
  513. #define VOXWARE_SAMPLE_SIZE_8BIT 1
  514. #define VOXWARE_SAMPLE_SIZE_16BIT 2
  515. #define VOXWARE_SAMPLE_INDEX_8BIT 0
  516. #define VOXWARE_SAMPLE_INDEX_16BIT 1
  517. #define VOXWARE_SAMPLE_INDEX_END (VOXWARE_SAMPLE_INDEX_16BIT+1)
  518. #define VOXWARE_NUM_SAMPLE_SIZES (VOXWARE_SAMPLE_INDEX_16BIT+1)
  519. #define VOXWARE_SAMPLE_SIZE_ARRAY {VOXWARE_SAMPLE_SIZE_8BIT, \
  520. VOXWARE_SAMPLE_SIZE_16BIT, \
  521. 0L}
  522. /*****************************************************************************
  523. **
  524. ** Some consts so you don't hard-coding anything!
  525. **
  526. *****************************************************************************/
  527. #define GAIN_ENERGY_LEVEL_CLIPPING (char) 200 /* You may be clipping if > */
  528. /* ...this level. */
  529. #define GAIN_ENERGY_LEVEL_TOO_LOW (char) 150 /* Speaker should not go */
  530. /* below this for very long.*/
  531. #define MAX_WARPED_LENGTH_FACTOR (float) 5.0
  532. #define MIN_WARPED_LENGTH_FACTOR (float) 0.2
  533. #define DEFAULT_WARPED_LENGTH_FACTOR (float) 1.0
  534. #define USE_ABSOLUTE_PITCH TRUE
  535. #define USE_RELATIVE_PITCH FALSE /* Default for bAbsolutePitchFlag */
  536. #define MAX_RELATIVE_PITCH (float) +24.0
  537. #define MIN_RELATIVE_PITCH (float) -24.0
  538. #define DEFAULT_RELATIVE_PITCH (float) 0.0
  539. #define MAX_ABSOLUTE_PITCH (float) 400.0
  540. #define MIN_ABSOLUTE_PITCH (float) 70.0
  541. #define USE_ABSOLUTE_GAIN TRUE
  542. #define USE_RELATIVE_GAIN FALSE /* Default for bUseAbsoluteGainFlag */
  543. #define MAX_RELATIVE_GAIN (float) +100.0
  544. #define MIN_RELATIVE_GAIN (float) -100.0
  545. #define DEFAULT_RELATIVE_GAIN (float) 0.0
  546. #define MAX_ABSOLUTE_GAIN (float) 255.0
  547. #define MIN_ABSOLUTE_GAIN (float) 0.0
  548. #define NO_VOICE_FONT NULL
  549. /* Assign the wVoiceFontType field to one of the following */
  550. #define VOICE_FONT_VERSION_ONE_POINTER (short) 0
  551. #define VOICE_FONT_BETA_2_STRUCT (short) 1
  552. /*
  553. The manual say's that the minimum size buffer you should ever
  554. pass in is 512 bytes. (Truth is, we don't need that much,
  555. but since I haven't called by psychic friend yet... I don't
  556. know what the future will hold -- :)
  557. */
  558. #define VOX_MINIMUM_BUFFER_SIZE (unsigned long) 512
  559. /* Version format: vers.rel.maint.patch - this is version 1.1.8.192 */
  560. #define TOOLVOX_VERSION_NUMBER 0x00010001L
  561. #define TOOLVOX_MAINTENANCE_LEVEL 0x000800C0L
  562. /* The following are obsolete spellings - use the constants #defined above. */
  563. #define VOXWARE_VERSION TOOLVOX_VERSION_NUMBER
  564. #define VOXWARE_MAINT TOOLVOX_MAINTENANCE_LEVEL
  565. /*****************************************************************************
  566. **
  567. ** Message values that are passed to the callback & the dwStatus field
  568. **
  569. *****************************************************************************/
  570. #define VOXWARE_PLAYBACKERROR 10
  571. #define VOXWARE_STARTCOMPRESS 11
  572. #define VOXWARE_ENDCOMPRESS 12
  573. #define VOXWARE_STARTDECOMPRESS 13
  574. #define VOXWARE_ENDDECOMPRESS 14
  575. #define VOXWARE_STARTPLAY 15
  576. #define VOXWARE_ENDPLAY 16
  577. //#define VOXWARE_STARTPITCH 17
  578. //#define VOXWARE_ENDPITCH 18
  579. #define VOXWARE_GETINFO 19
  580. #define VOXWARE_STARTRECORD 20 /* Added in Version 1.1 */
  581. #define VOXWARE_ENDRECORD 21 /* Added in Version 1.1 */
  582. #define VOXWARE_RECORDERROR 22 /* Added in Version 1.1 */
  583. #define VOXWARE_WAITING_TO_CLEANUP 23 /* Added in Version 1.1 */
  584. #define VOXWARE_PAUSED 24 /* Added in Version 1.2 */
  585. // ###lee: where is SOUNDOUT ??
  586. #define VOXWARE_FUNCTION_INIT 40 /* Added in Version 1.1 */
  587. #define VOXWARE_FUNCTION_READ 41 /* Added in Version 1.1 */
  588. #define VOXWARE_FUNCTION_WRITE 42 /* Added in Version 1.1 */
  589. #define VOXWARE_FUNCTION_CLEANUP 43 /* Added in Version 1.1 */
  590. /*****************************************************************************
  591. **
  592. ** Messages that are sent to the FILTER function
  593. **
  594. *****************************************************************************/
  595. #define VOXWARE_FILTER_INIT 50
  596. #define VOXWARE_FILTER_PCM 51
  597. #define VOXWARE_FILTER_CLEANUP 52
  598. /*****************************************************************************
  599. **
  600. ** Messages that are returned from the low level compress and decompress
  601. ** functions.
  602. **
  603. *****************************************************************************/
  604. #define VOXWARE_NEED_MORE_INPUT_DATA 91
  605. #define VOXWARE_OUTPUT_BUFFER_FULL 92
  606. #define VOXWARE_USER_ABORTED 93
  607. #define VOXWARE_USER_PAUSED 94
  608. /*****************************************************************************
  609. **
  610. ** Error return values.
  611. ** All the errors are described in more detail in the file: tvgetstr.c
  612. **
  613. *****************************************************************************/
  614. /* This is the return code for successful functions that work. */
  615. #define VOX_NO_ERROR 00000
  616. #define obsERR_BITS_PER_SAMPLE 101
  617. #define obsERR_SAMPLE_RATE 102
  618. #define VOXERR_FORMAT_PCM 103
  619. #define VOXERR_NOT_MONO 104
  620. #define VOXERR_VOXWARE_DATA_POINTER_NULL 105
  621. #define VOXERR_VOXWARE_DATA_SIZE 106
  622. #define VOXERR_VOX_FILE_INFO_POINTER_NULL 107
  623. #define VOXERR_VOX_FILE_INFO_SIZE 108
  624. #define VOXERR_VOX_VERSION_POINTER_NULL 109
  625. #define VOXERR_VOX_VERSION_SIZE 110
  626. #define VOXERR_VOX_VOICE_POINTER_NULL 111
  627. #define VOXERR_VOX_VOICE_NAME_NULL 112
  628. #define VOXERR_MORPHIO_POINTER_BAD 113
  629. #define VOXERR_INVALID_INPUT_TYPE 114
  630. #define VOXERR_INVALID_OUTPUT_TYPE 115
  631. #define VOXERR_INPUT_HANDLER 116
  632. #define VOXERR_OUTPUT_HANDLER 117
  633. #define VOXERR_PRIME_TIME 118
  634. #define VOXERR_WARP_2_BIG 119
  635. #define VOXERR_WARP_2_SMALL 120
  636. #define VOXERR_ABS_PITCH_2_BIG 121
  637. #define VOXERR_ABS_PITCH_2_SMALL 122
  638. #define VOXERR_REL_PITCH_2_BIG 123
  639. #define VOXERR_REL_PITCH_2_SMALL 124
  640. #define VOXERR_CODEC_UNKNOWN 125
  641. #define VOXERR_INPUT_BYTES_PER_SAMPLE 126
  642. #define VOXERR_OUTPUT_BYTES_PER_SAMPLE 127
  643. #define VOXERR_FORMAT_VOX 128
  644. #define VOXERR_UNKNOWN_ATTRIBUTE 129
  645. #define VOXERR_VWD_OR_VCB_IS_NULL 130
  646. #define VOXERR_NO_MARKERS_IN_INPUT_FILE 131
  647. #define VOXERR_BAD_SRC_4_MARKER_INPUT 132
  648. #define VOXERR_UNSUPPORTED_MARKER_CHUNK 133
  649. #define VOXERR_INVALID_MARKER_SELECTOR 134
  650. #define VOXERR_NO_INPUT_SAMPLE_SIZE 135
  651. #define VOXERR_NO_INPUT_SAMPLING_RATE 136
  652. #define VOXERR_BAD_INPUT_SAMPLING_RATE 137
  653. #define VOXERR_BAD_OUTPUT_SAMPLING_RATE 138
  654. /* A spot check of your machine and system software revealed a slight problem. */
  655. /* These are MacOS ONLY errors: */
  656. #define VOXERR_VALIDATE_NO_GESTALT 139
  657. #define VOXERR_VALIDATE_CPU_OLD_AS_DIRT 140
  658. #define VOXERR_VALIDATE_NO_FPU 141
  659. #define VOXERR_VALIDATE_FILE_MGR_TOO_OLD 142
  660. #define VOXERR_VALIDATE_NO_NOTIFICATION_MGR 143
  661. #define VOXERR_VALIDATE_YIKES_NO_SOUND_MGR 144
  662. #define VOXERR_VALIDATE_U_LACK_16BIT_SND 145
  663. #define VOXERR_VALIDATE_SND_MGR_NOT_CURRENT 146
  664. #define VOXERR_DONT_GIVE_INPUT_SAMPLE_RATE 147
  665. #define VOXERR_DONT_GIVE_INPUT_SAMPLE_SIZE 148
  666. #define VOXERR_NO_SAMPLE_RATE_FOR_VOX 149
  667. #define VOXERR_NO_SAMPLE_SIZE_FOR_VOX 150
  668. #define VOXERR_EFFECTS_ARE_NOT_SUPPORTED 151
  669. #define VOXERR_FX_R_4_DECOMPRESSION_ONLY 152
  670. #define VOXERR_ONLY_RT_8K_CODEC_AVAILABLE 153
  671. #define VOXERR_INVALID_MARKER_SIZEOF 154
  672. #define VOXERR_INVALID_VCB 155
  673. #define VOXERR_INVALID_OUTPUT_VARS 156
  674. #define VOXERR_INVALID_INPUT_VARS 157
  675. #define VOXERR_ABS_GAIN_2_BIG 158
  676. #define VOXERR_ABS_GAIN_2_SMALL 159
  677. #define VOXERR_REL_GAIN_2_BIG 160
  678. #define VOXERR_REL_GAIN_2_SMALL 161
  679. #define VOXERR_VOXWARE_ALREADY_INITIALIZED 162
  680. #define VOXERR_MUST_PLAY_TO_LOCATION_SOUND 163 // new, not yet in manual
  681. #define VOXERR_MUST_CALL_DCMP_TOOLVOX_PLAY 164 // new, not yet in manual
  682. #define VOXERR_FPU_DETECT 165 // new, not yet in manual
  683. #define VOXERR_IDENTIFYING_THE_CPU 166 // new, not yet in manual
  684. #define obsERR_IDENTIFYING_THE_OS 167 // bozo sabotage error... never use this.
  685. #define VOXERR_CODEC_NOT_AVAILABLE 168 // new, not yet in manual
  686. #define obsERR_DONT_GIVE_CODEC 169 // bozo sabotage error... never use this.
  687. #define VOXERR_DONT_GIVE_CMP_SETTINGS 170 // new, not yet in manual
  688. #define VOXERR_LINK_WITH_NATIVE_CODE 171 // mac only: new, not yet in manual
  689. /* File I/O error codes. */
  690. #define obsERR_DATA_CHUNK_SEEK 201
  691. #define obsERR_FMT_CHUNK_READ 202
  692. #define VOXERR_FMT_CHUNK_SIZE 203
  693. #define VOXERR_RIFF_CHUNK_READ 204
  694. #define VOXERR_VOX_HEADER_FLAG 205
  695. #define VOXERR_VOX_HEADER_SIZE 206
  696. #define obsERR_VOX_INIT_READ 207
  697. #define obsERR_VOX_INIT_WRITE 208
  698. #define obsERR_VOX_OPEN 209
  699. #define obsERR_VOX_READ 210
  700. #define obsERR_VOX_WRITE 211
  701. #define obsERR_WAVE_CKID 212
  702. #define obsERR_WAVE_INIT_READ 213
  703. #define obsERR_WAVE_INIT_WRITE 214
  704. #define obsERR_WAVE_OPEN 215
  705. #define obsERR_WAVE_READ 216
  706. #define obsERR_WAVE_WRITE 217
  707. #define VOXERR_VFONT_OPEN 218
  708. #define VOXERR_VFONT_READ 219
  709. #define VOXERR_VFONT_WRITE 220
  710. #define VOXERR_ENDOFFILE_REACHED 221
  711. #define VOXERR_READING_FROM_FILE 222
  712. #define VOXERR_WRITING_TO_FILE 223
  713. #define VOXERR_BAD_PATH_TO_FILE 224
  714. #define VOXERR_SET_FPOS 225
  715. #define VOXERR_OPENING_INPUT_FILE 226
  716. #define VOXERR_OPENING_OUTPUT_FILE 227
  717. #define VOXERR_CLOSING_INPUT_FILE 228
  718. #define VOXERR_CLOSING_OUTPUT_FILE 229
  719. #define VOXERR_READING_MARKER 230
  720. #define VOXERR_SEEKING_TO_MARKER_CHUNK 231
  721. #define VOXERR_MARKER_SEEK_RESET 232
  722. #define VOXERR_FAILED_SEEK_TO_MARKER 233
  723. #define VOXERR_REOPENING_MARKER_LOG 234
  724. #define VOXERR_OPENING_MARKER_LOG 235
  725. #define VOXERR_FAILED_TO_GET_EOF 236
  726. #define VOXERR_SEEKING_PAST_HEADER 237
  727. #define VOXERR_ENDOFBUFFER_REACHED 238
  728. /* Format/Header error codes */
  729. #define WheReIsErOrNuMbErThReEoOnE 301 //###lee
  730. #define VOXERR_UNKNOWN_HEADER_FORMAT 302
  731. #define VOXERR_WE_DONT_SUPPORT_RIFX 303
  732. #define VOXERR_WAVE_DOESNT_START_RIFF 304
  733. #define VOXERR_CANT_SURF_THIS_WAVE 305
  734. #define VOXERR_AIFF_COULDNT_FIND_ALL_CHUNKS 306
  735. #define VOXERR_HDR_MISSING_BITS_OF_DATA 307
  736. #define VOXERR_NOT_A_COMPRESSED_HEADER 308
  737. #define VOXERR_NO_CODECID_FOR_HEADER 309 // new MJ51
  738. #define VOXERR_UNKNOWN_CODECID_IN_HEADER 310 // new MJ67
  739. /* Memory allocation error codes. */
  740. #define VOXERR_PLAYBACK_MEMORY 401
  741. #define VOXERR_VOXSTRUCT_MEMORY 402
  742. #define obsERR_VOX_DATA_MEMORY 403
  743. #define obsERR_WAVE_DATA_MEMORY 404
  744. #define VOXERR_WAVEHDR_MEMORY 405
  745. #define VOXERR_VER_INFO_MEMORY 406
  746. #define VOXERR_MORPHIO_MEMORY 407
  747. #define VOXERR_INPUT_VARS_MEMORY 408
  748. #define VOXERR_OUTPUT_VARS_MEMORY 409
  749. #define VOXERR_RECORD_MEMORY 410
  750. #define VOXERR_MARKERS_MEMORY 411
  751. #define VOXERR_FILELINK_MEMORY 412
  752. #define VOXERR_READ_COMPLETION_MEMORY 413
  753. #define VOXERR_INPUT_DISKIO_MEMORY 414
  754. #define VOXERR_OUTPUT_DISKIO_MEMORY 415
  755. #define VOXERR_FLUSH_BUFFER_MEMORY 416
  756. #define VOXERR_FUNCIN_BUFFER_MEMORY 417
  757. #define VOXERR_FUNCOUT_BUFFER_MEMORY 418
  758. #define VOXERR_DEFERRED_TASK_PROC_MEMORY 419
  759. #define VOXERR_DEFERRED_TASK_MEMORY 420
  760. #define VOXERR_SOUND_CALLBACK_PROC_MEMORY 421
  761. #define VOXERR_NOTIFICATION_REC_MEMORY 422
  762. #define VOXERR_PLAYBACK_VARS_MEMORY 423
  763. #define VOXERR_PLAYBACK_BUFFER_MEMORY 424
  764. #define VOXERR_ORD_MARKERS_MEMORY 425
  765. #define VOXERR_MARKERS_TEMP_CHUNK_MEMORY 426
  766. #define VOXERR_WAVE_MARKER_CHUNK_MEMORY 427
  767. #define VOXERR_GENERIC_MARKERS_MEMORY 428
  768. #define VOXERR_TEMP_INPUT_BUFFER_MEMORY 429
  769. /* General system error codes. */
  770. #define VOXERR_BREW_BLACK_ART 501
  771. #define VOXERR_COMPRESSION 502
  772. #define VOXERR_CREATE_WINDOW 503
  773. #define VOXERR_DECOMPRESSION 504
  774. #define VOXERR_WAVEOUT_OPEN 505
  775. #define VOXERR_PREPARE_HDR 506
  776. #define VOXERR_WAVEOUT_WRITE 507
  777. #define VOXERR_WAVEIN_ADD_BUFFER 508
  778. #define VOXERR_WAVEIN_OPEN 509
  779. #define VOXERR_WAVEIN_START 510
  780. #define VOXERR_FUNCTION_EXPIRED 511
  781. #define VOXERR_NOT_ENOUGH_DATA_TO_COMPRESS 512
  782. #define VOXERR_COMPRESS_BUFFER 513
  783. #define VOXERR_PROCESSING_ABORTED 514 // new, not yet in manual
  784. #define VOXERR_PAUSING 515 // new MJ44 -- not yet in manual
  785. #define VOXERR_RESUMING 516 // new MJ44 -- not yet in manual
  786. #define VOXERR_FLUSHCMD 517 // new MJ44 -- not yet in manual
  787. #define VOXERR_QUIETCMD 518 // new MJ44 -- not yet in manual
  788. #define VOXERR_BUFFERCMD 519 // new MJ44 -- not yet in manual
  789. #define VOXERR_CALLBACKCMD 520 // new MJ44 -- not yet in manual
  790. #define VOXERR_DTINSTALL_FAILED 521 // new MJ44 -- not yet in manual
  791. /* Errors that occur using the VoiceFonts API. */
  792. #define VOXERR_VFONT_FILE_NOT_FOUND 601
  793. #define VOXERR_VFONT_WRONGNAME 602
  794. #define VOXERR_VFONT_DELETE 603
  795. #define VOXERR_VFONT_FILE_FORMAT 604
  796. #define VOXERR_MORPHIO_HANDLE_INVALID 605
  797. #define VOXERR_VFII_UNKNOWN_VOICE_FONT 606 // new MJ50 -- not yet in manual
  798. #define VOXERR_VFII_UNKNOWN_VF_CHUNK_SIZE 607 // new MJ50 -- not yet in manual
  799. /*****************************************************************************
  800. **
  801. ** Header routines to convert from digitized speech to VOX data. They all
  802. ** take PCM data as input and output compressed VOX data.
  803. **
  804. *****************************************************************************/
  805. /* New calls that have the properties of all of the other calls. The routine
  806. ** use the dwInputType and dwOutputType fields to tell how to process the data.
  807. ** This makes the older calls obsolete (yet still supported).
  808. */
  809. VOXWARE_RETCODE VOXAPI cmpToolVoxRecord(LPVOXWARE_DATA lpVoxwareData);
  810. VOXWARE_RETCODE VOXAPI cmpToolVoxCompress(LPVOXWARE_DATA lpVoxwareData);
  811. /* These routines are used for low-level compression. */
  812. VOXWARE_RETCODE VOXAPI cmpVoxInit(LPVOXWARE_DATA lpVoxwareData);
  813. VOXWARE_RETCODE VOXAPI cmpVoxConvert(LPVOXWARE_DATA lpVoxwareData);
  814. VOXWARE_RETCODE VOXAPI cmpVoxFree(LPVOXWARE_DATA lpVoxwareData);
  815. /* Older functions that are only here for backwards compatibility. */
  816. VOXWARE_RETCODE VOXAPI cmpFileToVoxFile(LPVOXWARE_DATA lpVoxwareData);
  817. VOXWARE_RETCODE VOXAPI cmpFileToVoxBuffer(LPVOXWARE_DATA lpVoxwareData);
  818. VOXWARE_RETCODE VOXAPI cmpBufferToVoxFile(LPVOXWARE_DATA lpVoxwareData);
  819. /*****************************************************************************
  820. **
  821. ** Header routines to convert from VOX data to digitized speech. They all
  822. ** take VOX data as input (either as VOX file or a buffer of VOX data) and
  823. ** output decompressed PCM data. There is also a routine to play VOX or PCM
  824. ** data.
  825. **
  826. *****************************************************************************/
  827. VOXWARE_RETCODE VOXAPI dcmpToolVoxPlay(LPVOXWARE_DATA lpVoxwareData);
  828. VOXWARE_RETCODE VOXAPI dcmpToolVoxDecompress(LPVOXWARE_DATA lpVoxwareData);
  829. VOXWARE_RETCODE VOXAPI dcmpToolVoxStop(LPVOXWARE_DATA lpVoxwareData); // MacOS only
  830. VOXWARE_RETCODE VOXAPI dcmpToolVoxPause(LPVOXWARE_DATA lpVoxwareData); // Hidden API don't use.
  831. VOXWARE_RETCODE VOXAPI dcmpToolVoxResume(LPVOXWARE_DATA lpVoxwareData); // Hidden API don't use.
  832. VOXWARE_RETCODE VOXAPI dcmpSetBitOffset(LPVOXWARE_DATA lpVoxwareData, short newOffset); // Hidden API don't use.
  833. /* These routines are used for low-level decompression. */
  834. VOXWARE_RETCODE VOXAPI dcmpVoxInit(LPVOXWARE_DATA lpVoxwareData);
  835. VOXWARE_RETCODE VOXAPI dcmpVoxConvert(LPVOXWARE_DATA lpVoxwareData);
  836. VOXWARE_RETCODE VOXAPI dcmpVoxFree(LPVOXWARE_DATA lpVoxwareData);
  837. /* Older functions that are only here for backwards compatibility. */
  838. VOXWARE_RETCODE VOXAPI dcmpVoxFileToFile(LPVOXWARE_DATA lpVoxwareData);
  839. VOXWARE_RETCODE VOXAPI dcmpVoxFileToBuffer(LPVOXWARE_DATA lpVoxwareData);
  840. VOXWARE_RETCODE VOXAPI dcmpVoxBufferToFile(LPVOXWARE_DATA lpVoxwareData);
  841. VOXWARE_RETCODE VOXAPI dcmpPlayVoxFile(LPVOXWARE_DATA lpVoxwareData);
  842. VOXWARE_RETCODE VOXAPI dcmpPlayVoxBuffer(LPVOXWARE_DATA lpVoxwareData);
  843. /*****************************************************************************
  844. **
  845. ** These utility routines can be used to get information about the speed of
  846. ** the ToolVox compression or to get file information about an AIFF or VOX
  847. ** file. There are also routines to get and set different attributes of the
  848. ** ToolVox API.
  849. **
  850. *****************************************************************************/
  851. VOXWARE_RETCODE VOXAPI utilGetFileInfo(LPVOXWARE_DATA lpVoxwareData);
  852. VOXWARE_RETCODE VOXAPI utilGetVersionInfo(LPVOXWARE_DATA lpVoxwareData);
  853. VOXWARE_RETCODE VOXAPI utilToolVoxGetAttribute(
  854. LPVOXWARE_DATA lpVoxwareData,
  855. LPVOX_COMMAND lpCommand);
  856. VOXWARE_RETCODE VOXAPI utilToolVoxSetAttribute(
  857. LPVOXWARE_DATA lpVoxwareData,
  858. LPVOX_COMMAND lpCommand);
  859. /*****************************************************************************
  860. **
  861. ** This prototype is for the callback function that can be passed to ToolVox
  862. ** in the VOXWARE_DATA structure. If you create this function, it must be
  863. ** in a FIXED/Locked segment!
  864. **
  865. *****************************************************************************/
  866. VOXAPI_CALLBACK VoxFunc(
  867. unsigned short wVox,
  868. unsigned short wMessage,
  869. LPVOXWARE_DATA lpVoxwareData);
  870. #ifndef VOXWARE_SUN
  871. #if PRAGMA_ALIGN_SUPPORTED
  872. #pragma options align=reset
  873. #elif VOXWARE_HP
  874. #pragma HP_ALIGN HPUX_NATURAL
  875. #else
  876. #pragma pack()
  877. #endif
  878. #endif
  879. #ifdef __cplusplus
  880. }
  881. #endif
  882. #endif /*__TOOLVOX_H_*/