eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
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.

ssml.h 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* SSML (Speech Synthesis Markup Language) processing APIs.
  2. *
  3. * Copyright (C) 2005 to 2015 by Jonathan Duddington
  4. * email: [email protected]
  5. * Copyright (C) 2015-2018 Reece H. Dunn
  6. * Copyright (C) 2018 Juho Hiltunen
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef ESPEAK_NG_SSML_API
  22. #define ESPEAK_NG_SSML_API
  23. #include <stdbool.h>
  24. #include <wchar.h>
  25. #include <espeak-ng/speak_lib.h>
  26. #ifdef __cplusplus
  27. extern "C"
  28. {
  29. #endif
  30. // stack for language and voice properties
  31. // frame 0 is for the defaults, before any ssml tags.
  32. typedef struct {
  33. int tag_type;
  34. int voice_variant_number;
  35. int voice_gender;
  36. int voice_age;
  37. char voice_name[40];
  38. char language[20];
  39. } SSML_STACK;
  40. #define N_PARAM_STACK 20
  41. #define SSML_SPEAK 1
  42. #define SSML_VOICE 2
  43. #define SSML_PROSODY 3
  44. #define SSML_SAYAS 4
  45. #define SSML_MARK 5
  46. #define SSML_SENTENCE 6
  47. #define SSML_PARAGRAPH 7
  48. #define SSML_PHONEME 8
  49. #define SSML_SUB 9
  50. #define SSML_STYLE 10
  51. #define SSML_AUDIO 11
  52. #define SSML_EMPHASIS 12
  53. #define SSML_BREAK 13
  54. #define SSML_IGNORE_TEXT 14
  55. #define HTML_BREAK 15
  56. #define HTML_NOSPACE 16 // don't insert a space for this element, so it doesn't break a word
  57. #define SSML_CLOSE 0x20 // for a closing tag, OR this with the tag type
  58. int ProcessSsmlTag(wchar_t *xml_buf,
  59. char *outbuf,
  60. int *outix,
  61. int n_outbuf,
  62. bool self_closing,
  63. const char *xmlbase,
  64. bool *audio_text,
  65. char *current_voice_id,
  66. espeak_VOICE *base_voice,
  67. char *base_voice_variant_name,
  68. bool *ignore_text,
  69. bool *clear_skipping_text,
  70. int *sayas_mode,
  71. int *sayas_start,
  72. SSML_STACK *ssml_stack,
  73. int *n_ssml_stack,
  74. int *n_param_stack,
  75. int *speech_parameters);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif