demo.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <include>
  2. <macro name="saymoney">
  3. <input pattern="(.*)">
  4. <match>
  5. <action function="say" data="$1" method="pronounced" type="currency"/>
  6. </match>
  7. </input>
  8. </macro>
  9. <macro name="msgcount">
  10. <input pattern="(.*)">
  11. <match>
  12. <action function="execute" data="sleep(1000)"/>
  13. <action function="play-file" data="voicemail/vm-you_have.wav"/>
  14. <action function="say" data="$1" method="pronounced" type="items"/>
  15. <action function="play-file" data="voicemail/vm-messages.wav"/>
  16. <!-- or -->
  17. <!--<action function="speak-text" data="you have $1 messages"/>-->
  18. </match>
  19. </input>
  20. </macro>
  21. <macro name="saydate">
  22. <input pattern="(.*)">
  23. <match>
  24. <action function="say" data="$1" method="pronounced" type="current_date_time"/>
  25. </match>
  26. </input>
  27. </macro>
  28. <macro name="saydatetime">
  29. <input pattern="(.*)">
  30. <match>
  31. <action function="say" data="$1" method="pronounced" type="current_date_time"/>
  32. </match>
  33. </input>
  34. </macro>
  35. <macro name="timespec">
  36. <input pattern="(.*)">
  37. <match>
  38. <action function="say" data="$1" method="pronounced" type="time_measurement"/>
  39. </match>
  40. </input>
  41. </macro>
  42. <macro name="timespec2">
  43. <input pattern="(.*)">
  44. <match>
  45. <action function="say" data="$1" method="pronounced" type="CURRENT_DATE_TIME"/>
  46. </match>
  47. </input>
  48. </macro>
  49. <macro name="ip-addr-interated">
  50. <input pattern="(.*)">
  51. <match>
  52. <action function="say" data="$1" method="iterated" type="ip_address"/>
  53. </match>
  54. </input>
  55. </macro>
  56. <macro name="ip-addr">
  57. <input pattern="(.*)">
  58. <match>
  59. <action function="say" data="$1" method="pronounced" type="ip_address"/>
  60. </match>
  61. </input>
  62. </macro>
  63. <macro name="spell">
  64. <input pattern="(.*)">
  65. <match>
  66. <action function="say" data="$1" method="pronounced" type="name_spelled"/>
  67. </match>
  68. </input>
  69. </macro>
  70. <macro name="spell-phonetic">
  71. <input pattern="(.*)">
  72. <match>
  73. <action function="say" data="$1" method="pronounced" type="name_phonetic"/>
  74. </match>
  75. </input>
  76. </macro>
  77. <macro name="tts-timeleft">
  78. <!-- The parser will visit each <input> tag and execute the actions in <match> or <nomatch> depending on the pattern param -->
  79. <!-- If the function "break" is encountered all parsing will cease -->
  80. <input pattern="(\d+):(\d+)">
  81. <match>
  82. <action function="speak-text" data="You have $1 minutes, $2 seconds remaining $strftime(%Y-%m-%d)"/>
  83. <action function="break"/>
  84. </match>
  85. <nomatch>
  86. <action function="speak-text" data="That input was invalid."/>
  87. </nomatch>
  88. </input>
  89. <input pattern="(\d+) min (\d+) sec">
  90. <match>
  91. <action function="speak-text" data="You have $1 minutes, $2 seconds remaining $strftime(%Y-%m-%d)"/>
  92. </match>
  93. <nomatch>
  94. <action function="speak-text" data="That input was invalid."/>
  95. </nomatch>
  96. </input>
  97. </macro>
  98. </include>
  99. <!--
  100. For Emacs:
  101. Local Variables:
  102. mode:xml
  103. indent-tabs-mode:nil
  104. tab-width:2
  105. c-basic-offset:2
  106. End:
  107. For VIM:
  108. vim:set softtabstop=2 shiftwidth=2 tabstop=2 expandtab:
  109. -->