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.8KB

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