Source code of Windows XP (NT5)
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.

418 lines
11 KiB

  1. /*******************************************************************************
  2. * Data.cpp *
  3. *----------*
  4. * Description:
  5. * Constant data tables.
  6. *-------------------------------------------------------------------------------
  7. * Created By: mc Date: 03/12/99
  8. * Copyright (C) 1999 Microsoft Corporation
  9. * All Rights Reserved
  10. *
  11. *******************************************************************************/
  12. #ifndef AlloOps_H
  13. #include "AlloOps.h"
  14. #endif
  15. #ifndef __spttseng_h__
  16. #include "spttseng.h"
  17. #endif
  18. #ifndef Frontend_H
  19. #include "Frontend.h"
  20. #endif
  21. #pragma warning(disable : 4305)
  22. #pragma warning(disable : 4309)
  23. #define PUNCT_GAIN 1.67
  24. #define PUNCT_GAIN1 1.33
  25. #define SUB1_GAIN 1.00
  26. #define SUB2_GAIN 1.00
  27. // I don't understand why I had to add "extern" here.
  28. // If YOU do, please explain here for the rest of us:
  29. extern const float g_BoundryStretchTbl[] =
  30. {
  31. 1.0, // NULL_BOUNDARY = 0, // no boundary
  32. PUNCT_GAIN1, // PHRASE_BOUNDARY, // comma
  33. PUNCT_GAIN, // EXCLAM_BOUNDARY, // exclamatory utterance terminator
  34. PUNCT_GAIN, // YN_QUEST_BOUNDARY, // yes-no question terminator
  35. PUNCT_GAIN, // WH_QUEST_BOUNDARY, // yes-no question terminator
  36. PUNCT_GAIN, // DECLAR_BOUNDARY, // declarative terminator
  37. SUB1_GAIN, // PAREN_L_BOUNDARY, // left paren
  38. SUB1_GAIN, // PAREN_R_BOUNDARY, // right paren
  39. SUB1_GAIN, // QUOTE_L_BOUNDARY, // left quote
  40. SUB1_GAIN, // QUOTE_R_BOUNDARY, // right quote
  41. SUB1_GAIN, // PHONE_BOUNDARY, // Telephone number
  42. 1.30, // TOD_BOUNDARY, // Time-of-day
  43. SUB2_GAIN, // SUB_BOUNDARY_1, // NOTE: always put these at the end
  44. SUB2_GAIN, // SUB_BOUNDARY_2,
  45. SUB2_GAIN, // SUB_BOUNDARY_3,
  46. SUB2_GAIN, // SUB_BOUNDARY_4,
  47. SUB2_GAIN, // SUB_BOUNDARY_5,
  48. SUB2_GAIN, // SUB_BOUNDARY_6,
  49. SUB2_GAIN, // NUMBER_BOUNDARY,
  50. 1.0, // TAIL_BOUNDARY
  51. };
  52. extern const float g_BoundryDurTbl[] =
  53. {
  54. 0.200, // NULL_BOUNDARY = 0, // no boundary
  55. 0.200, // PHRASE_BOUNDARY, // comma
  56. 0.300, // EXCLAM_BOUNDARY, // exclamatory utterance terminator
  57. 0.300, // YN_QUEST_BOUNDARY, // yes-no question terminator
  58. 0.300, // WH_QUEST_BOUNDARY, // wh question terminator
  59. 0.300, // DECLAR_BOUNDARY, // declarative terminator
  60. 0.200, // PAREN_L_BOUNDARY, // left paren
  61. 0.200, // PAREN_R_BOUNDARY, // right paren
  62. 0.200, // QUOTE_L_BOUNDARY, // left quote
  63. 0.200, // QUOTE_R_BOUNDARY, // right quote
  64. 0.100, // PHONE_BOUNDARY, // Telephone number
  65. 0.010, // TOD_BOUNDARY, // Time-of-day
  66. 0.200, // ELLIPSIS_BOUNDARY, // Ellipsis
  67. 0.001, // SUB_BOUNDARY_1, // NOTE: always put these at the end
  68. 0.001, // SUB_BOUNDARY_2,
  69. 0.001, // SUB_BOUNDARY_3,
  70. 0.001, // SUB_BOUNDARY_4,
  71. 0.001, // SUB_BOUNDARY_5,
  72. 0.001, // SUB_BOUNDARY_6,
  73. 0.001, // NUMBER_BOUNDARY,
  74. 0.001, // TAIL_BOUNDARY,
  75. };
  76. //-------------------------------------------
  77. // Translate -24 <--> +24 pitch control to
  78. // 24th root of two pitch scale
  79. //-------------------------------------------
  80. extern const float g_PitchScale[] =
  81. {
  82. 1.0,
  83. 1.0293022366434920287823718007739,
  84. 1.0594630943592952645618252949463,
  85. 1.0905077326652576592070106557607,
  86. 1.1224620483093729814335330496792,
  87. 1.1553526968722730102453370986819,
  88. 1.1892071150027210667174999705605,
  89. 1.2240535433046552391321602168255,
  90. 1.2599210498948731647672106072777,
  91. 1.2968395546510096659337541177919,
  92. 1.3348398541700343648308318811839,
  93. 1.3739536474580891017766557477492,
  94. 1.4142135623730950488016887242091,
  95. 1.4556531828421873543551155614673,
  96. 1.4983070768766814987992807320292,
  97. 1.5422108254079408236122918620901,
  98. 1.5874010519681994747517056392717,
  99. 1.6339154532410998436782440504114,
  100. 1.6817928305074290860622509524658,
  101. 1.7310731220122860533901844375553,
  102. 1.7817974362806786094804524111803,
  103. 1.8340080864093424634870831895876,
  104. 1.8877486253633869932838263133343,
  105. 1.9430638823072117374865788316417,
  106. 2.0
  107. };
  108. //-------------------------------------------
  109. // Translate -10 <--> +10 rate control to
  110. // 10th root of three rate scale
  111. //-------------------------------------------
  112. extern const float g_RateScale[] =
  113. {
  114. 1.0,
  115. 1.1161231740339044344426141383771,
  116. 1.2457309396155173259666803366403,
  117. 1.3903891703159093404852542946161,
  118. 1.5518455739153596742733451355167,
  119. 1.7320508075688772935274463415059,
  120. 1.9331820449317627515248789432662,
  121. 2.1576692799745930995549489159803,
  122. 2.4082246852806920462855086141912,
  123. 2.6878753795222865835819210737269,
  124. 3,
  125. 3.348369522101713303327842415131,
  126. 3.7371928188465519779000410099203,
  127. 4.1711675109477280214557628838472,
  128. 4.6555367217460790228200354065486,
  129. 5.1961524227066318805823390245155,
  130. 5.7995461347952882545746368297956,
  131. 6.4730078399237792986648467479371,
  132. 7.2246740558420761388565258425687,
  133. };
  134. extern const unsigned short g_Opcode_To_ASCII[] =
  135. {
  136. 'IY', 'IH', 'EH', 'AE', 'AA', 'AH', 'AO', 'UH', 'AX', 'ER',
  137. 'EY', 'AY', 'OY', 'AW', 'OW', 'UW',
  138. 'IX', '_', 'w', 'y',
  139. 'r', 'l', 'h', 'm', 'n', 'NG', 'f', 'v', 'TH', 'DH',
  140. 's', 'z', 'SH', 'ZH', 'p', 'b', 't', 'd', 'k', 'g',
  141. 'CH', 'JH', 'DX', '1', '2', '3', '/',
  142. 0x5C, '>', '<', '=', '_', '*', '$', ',', '.', '?',
  143. '!', '-', '#', '+', '~', '@', 0, 0, 0, 0
  144. };
  145. extern const unsigned long g_AlloFlags[] =
  146. {
  147. // IY
  148. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KYGLIDEENDF + KFRONTF,
  149. // IH
  150. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KFRONTF,
  151. // EH
  152. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KFRONTF,
  153. // AE
  154. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KFRONTF,
  155. // AA
  156. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  157. // AH
  158. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  159. // AO
  160. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  161. // UH
  162. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  163. // AX
  164. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  165. // ER
  166. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F,
  167. // EY
  168. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KYGLIDEENDF + KFRONTF + KDIPHTHONGF,
  169. // AY
  170. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KDIPHTHONGF,
  171. // OY
  172. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KDIPHTHONGF,
  173. // AW
  174. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KDIPHTHONGF,
  175. // OW
  176. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KDIPHTHONGF,
  177. // UW
  178. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KDIPHTHONGF,
  179. // IX
  180. KVOWELF + KVOICEDF + KVOWEL1F + KSONORANTF + KSONORANT1F + KFRONTF,
  181. // SIL
  182. KSONORANT1F,
  183. // W
  184. KVOICEDF + KSONORANTF + KSONORANT1F + KCONSONANTF + KLIQGLIDEF + KSONORCONSONF + KLIQGLIDE2F,
  185. // Y
  186. KVOICEDF + KSONORANTF + KSONORANT1F + KCONSONANTF + KLIQGLIDEF + KSONORCONSONF + KYGLIDESTARTF + KYGLIDEENDF,
  187. // R
  188. KVOICEDF + KSONORANTF + KSONORANT1F + KCONSONANTF + KLIQGLIDEF + KSONORCONSONF + KLIQGLIDE2F,
  189. // L
  190. KVOICEDF + KSONORANTF + KSONORANT1F + KCONSONANTF + KLIQGLIDEF + KSONORCONSONF,
  191. // H
  192. KSONORANT1F + KCONSONANTF,
  193. // M
  194. KVOICEDF + KSONORANTF + KSONORANT1F + KNASALF + KCONSONANTF + KSONORCONSONF + KOBSTF + KLABIALF + KHASRELEASEF,
  195. // N
  196. KVOICEDF + KSONORANTF + KSONORANT1F + KNASALF + KCONSONANTF + KSONORCONSONF + KOBSTF + KALVEOLARF + KHASRELEASEF,
  197. // NG
  198. KVOICEDF + KSONORANTF + KSONORANT1F + KNASALF + KCONSONANTF + KSONORCONSONF + KOBSTF + KVELAR + KHASRELEASEF,
  199. // F
  200. KPLOSFRICF + KCONSONANTF + KLABIALF + KFRIC,
  201. // V
  202. KVOICEDF + KPLOSFRICF + KCONSONANTF + KLABIALF + KFRIC,
  203. // TH
  204. KPLOSFRICF + KCONSONANTF + KDENTALF + KFRIC,
  205. // DH
  206. KVOICEDF + KPLOSFRICF + KCONSONANTF + KDENTALF + KFRIC,
  207. // S
  208. KPLOSFRICF + KCONSONANTF + KALVEOLARF + KFRIC,
  209. // Z
  210. KVOICEDF + KPLOSFRICF + KCONSONANTF + KALVEOLARF + KFRIC,
  211. // SH
  212. KPLOSFRICF + KCONSONANTF + KPALATALF + KFRIC,
  213. // ZH
  214. KVOICEDF + KPLOSFRICF + KCONSONANTF + KPALATALF + KFRIC,
  215. // P
  216. KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KLABIALF + KHASRELEASEF,
  217. // B
  218. KVOICEDF + KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KLABIALF + KHASRELEASEF,
  219. // T
  220. KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KALVEOLARF + KHASRELEASEF,
  221. // D
  222. KVOICEDF + KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KALVEOLARF + KHASRELEASEF,
  223. // K
  224. KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KVELAR + KHASRELEASEF,
  225. // G
  226. KVOICEDF + KPLOSFRICF + KSTOPF + KCONSONANTF + KPLOSIVEF + KOBSTF + KVELAR + KHASRELEASEF,
  227. // CH
  228. KPLOSFRICF + KCONSONANTF + KPLOSIVEF + KOBSTF + KPALATALF + KAFFRICATEF,
  229. // JH
  230. KVOICEDF + KPLOSFRICF + KCONSONANTF + KPLOSIVEF + KOBSTF + KPALATALF + KAFFRICATEF,
  231. // DX
  232. KVOICEDF + KPLOSFRICF + KCONSONANTF + KOBSTF,
  233. };
  234. extern const short g_IPAToAllo[] =
  235. {
  236. 28, // _IY_
  237. 27, // _IH_
  238. 21, // _EH_
  239. 11, // _AE_
  240. 10, // _AA_
  241. 12, // _AH_
  242. 13, // _AO_
  243. 43, // _UH_
  244. 15, // _AX_
  245. 22, // _ER_
  246. 23, // _EY_
  247. 16, // _AY_
  248. 36, // _OY_
  249. 14, // _AW_
  250. 35, // _OW_
  251. 44, // _UW_
  252. NO_IPA, // _IX_
  253. 7, // _SIL_
  254. 46, // _w_
  255. 47, // _y_
  256. 38, // _r_ 0x279
  257. 31, // _l_
  258. 26, // _h_ 0x68
  259. 32, // _m_
  260. 33, // _n_
  261. 34, // _NG_
  262. 24, // _f_
  263. 45, // _v_
  264. 42, // _TH_
  265. 20, // _DH_
  266. 39, // _s_
  267. 48, // _z_
  268. 40, // _SH_
  269. 49, // _ZH_
  270. 37, // _p_
  271. 17, // _b_
  272. 41, // _t_
  273. 19, // _d_
  274. 30, // _k_
  275. 25, // _g_ 0x67
  276. 18, // _CH_
  277. 29, // _JH_ 0x2a4
  278. NO_IPA, // _DX_ // @@@@
  279. 8, // _STRESS1_
  280. 9, // _STRESS2_
  281. NO_IPA, // _EMPHSTRESS_
  282. 1, // _SYLLABLE_
  283. };
  284. extern const short g_AlloToViseme[] =
  285. {
  286. SP_VISEME_6, // _IY_
  287. SP_VISEME_6, // _IH_
  288. SP_VISEME_4, // _EH_
  289. SP_VISEME_1, // _AE_
  290. SP_VISEME_2, // _AA_
  291. SP_VISEME_1, // _AH_
  292. SP_VISEME_3, // _AO_
  293. SP_VISEME_4, // _UH_
  294. SP_VISEME_1, // _AX_
  295. SP_VISEME_5, // _ER_
  296. SP_VISEME_4, // _EY_
  297. SP_VISEME_11, // _AY_
  298. SP_VISEME_10, // _OY_
  299. SP_VISEME_9, // _AW_
  300. SP_VISEME_8, // _OW_
  301. SP_VISEME_7, // _UW_
  302. SP_VISEME_6, // _IX_
  303. SP_VISEME_0, // _SIL_
  304. SP_VISEME_7, // _w_
  305. SP_VISEME_6, // _y_
  306. SP_VISEME_13, // _r_
  307. SP_VISEME_14, // _l_
  308. SP_VISEME_12, // _h_
  309. SP_VISEME_21, // _m_
  310. SP_VISEME_19, // _n_
  311. SP_VISEME_20, // _NG_
  312. SP_VISEME_18, // _f_
  313. SP_VISEME_18, // _v_
  314. SP_VISEME_17, // _TH_
  315. SP_VISEME_17, // _DH_
  316. SP_VISEME_15, // _s_
  317. SP_VISEME_15, // _z_
  318. SP_VISEME_16, // _SH_
  319. SP_VISEME_16, // _ZH_
  320. SP_VISEME_21, // _p_
  321. SP_VISEME_21, // _b_
  322. SP_VISEME_19, // _t_
  323. SP_VISEME_19, // _d_
  324. SP_VISEME_20, // _k_
  325. SP_VISEME_20, // _g_
  326. SP_VISEME_16, // _CH_
  327. SP_VISEME_16, // _JH_
  328. SP_VISEME_13, // _DX_ // @@@@
  329. };