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.

espeak_command.h 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #ifndef ESPEAK_COMMAND_H
  2. #define ESPEAK_COMMAND_H
  3. #ifndef PLATFORM_WINDOWS
  4. #include <unistd.h>
  5. #endif
  6. #include "speak_lib.h"
  7. #ifdef __cplusplus
  8. extern "C"
  9. {
  10. #endif
  11. typedef enum
  12. {
  13. ET_TEXT,
  14. ET_MARK,
  15. ET_KEY,
  16. ET_CHAR,
  17. ET_PARAMETER,
  18. ET_PUNCTUATION_LIST,
  19. ET_VOICE_NAME,
  20. ET_VOICE_SPEC,
  21. ET_TERMINATED_MSG
  22. } t_espeak_type;
  23. typedef struct
  24. {
  25. unsigned int unique_identifier;
  26. void* text;
  27. size_t size;
  28. unsigned int position;
  29. espeak_POSITION_TYPE position_type;
  30. unsigned int end_position;
  31. unsigned int flags;
  32. void* user_data;
  33. } t_espeak_text;
  34. typedef struct
  35. {
  36. unsigned int unique_identifier;
  37. void* text;
  38. size_t size;
  39. const char* index_mark;
  40. unsigned int end_position;
  41. unsigned int flags;
  42. void* user_data;
  43. } t_espeak_mark;
  44. typedef struct
  45. {
  46. unsigned int unique_identifier;
  47. void* user_data;
  48. wchar_t character;
  49. } t_espeak_character;
  50. typedef struct
  51. {
  52. unsigned int unique_identifier;
  53. void* user_data;
  54. const char* key_name;
  55. } t_espeak_key;
  56. typedef struct
  57. {
  58. unsigned int unique_identifier;
  59. void* user_data;
  60. } t_espeak_terminated_msg;
  61. typedef struct
  62. {
  63. espeak_PARAMETER parameter;
  64. int value;
  65. int relative;
  66. } t_espeak_parameter;
  67. typedef enum
  68. {
  69. CS_UNDEFINED, // The command has just been created
  70. CS_PENDING, // stored in the fifo
  71. CS_PROCESSED // processed
  72. } t_command_state;
  73. typedef struct
  74. {
  75. t_espeak_type type;
  76. t_command_state state;
  77. union command
  78. {
  79. t_espeak_text my_text;
  80. t_espeak_mark my_mark;
  81. t_espeak_key my_key;
  82. t_espeak_character my_char;
  83. t_espeak_parameter my_param;
  84. const wchar_t* my_punctuation_list;
  85. const char *my_voice_name;
  86. espeak_VOICE my_voice_spec;
  87. t_espeak_terminated_msg my_terminated_msg;
  88. } u;
  89. } t_espeak_command;
  90. t_espeak_command* create_espeak_text(const void *text, size_t size, unsigned int position, espeak_POSITION_TYPE position_type, unsigned int end_position, unsigned int flags, void* user_data);
  91. t_espeak_command* create_espeak_mark(const void *text, size_t size, const char *index_mark, unsigned int end_position, unsigned int flags, void* user_data);
  92. t_espeak_command* create_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
  93. t_espeak_command* create_espeak_key(const char *key_name, void *user_data);
  94. t_espeak_command* create_espeak_char(wchar_t character, void *user_data);
  95. t_espeak_command* create_espeak_parameter(espeak_PARAMETER parameter, int value, int relative);
  96. t_espeak_command* create_espeak_punctuation_list(const wchar_t *punctlist);
  97. t_espeak_command* create_espeak_voice_name(const char *name);
  98. t_espeak_command* create_espeak_voice_spec(espeak_VOICE *voice_spec);
  99. void process_espeak_command( t_espeak_command* the_command);
  100. int delete_espeak_command( t_espeak_command* the_command);
  101. void display_espeak_command(t_espeak_command* the_command);
  102. espeak_ERROR sync_espeak_Synth(unsigned int unique_identifier, const void *text, size_t size,
  103. unsigned int position, espeak_POSITION_TYPE position_type,
  104. unsigned int end_position, unsigned int flags, void* user_data);
  105. espeak_ERROR sync_espeak_Synth_Mark(unsigned int unique_identifier, const void *text, size_t size,
  106. const char *index_mark, unsigned int end_position,
  107. unsigned int flags, void* user_data);
  108. void sync_espeak_Key(const char *key);
  109. void sync_espeak_Char(wchar_t character);
  110. void sync_espeak_SetPunctuationList(const wchar_t *punctlist);
  111. void sync_espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
  112. int sync_espeak_SetVoiceByName(const char *name);
  113. int sync_espeak_SetVoiceByProperties(espeak_VOICE *voice_selector);
  114. espeak_ERROR SetVoiceByName(const char *name);
  115. espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector);
  116. void SetParameter(int parameter, int value, int relative);
  117. int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. //>
  122. #endif