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_ng.h 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* eSpeak NG API.
  2. *
  3. * Copyright (C) 2015-2017 Reece H. Dunn
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef ESPEAK_NG_H
  19. #define ESPEAK_NG_H
  20. #include <espeak-ng/speak_lib.h>
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. #if defined(_WIN32) || defined(_WIN64)
  26. #ifdef LIBESPEAK_NG_EXPORT
  27. #define ESPEAK_NG_API __declspec(dllexport)
  28. #else
  29. #define ESPEAK_NG_API __declspec(dllimport)
  30. #endif
  31. #else
  32. #define ESPEAK_NG_API
  33. #endif
  34. typedef enum {
  35. ENS_GROUP_MASK = 0x70000000,
  36. ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */
  37. ENS_GROUP_ESPEAK_NG = 0x10000000, /* eSpeak NG error codes. */
  38. /* eSpeak NG 1.49.0 */
  39. ENS_OK = 0,
  40. ENS_COMPILE_ERROR = 0x100001FF,
  41. ENS_VERSION_MISMATCH = 0x100002FF,
  42. ENS_FIFO_BUFFER_FULL = 0x100003FF,
  43. ENS_NOT_INITIALIZED = 0x100004FF,
  44. ENS_AUDIO_ERROR = 0x100005FF,
  45. ENS_VOICE_NOT_FOUND = 0x100006FF,
  46. ENS_MBROLA_NOT_FOUND = 0x100007FF,
  47. ENS_MBROLA_VOICE_NOT_FOUND = 0x100008FF,
  48. ENS_EVENT_BUFFER_FULL = 0x100009FF,
  49. ENS_NOT_SUPPORTED = 0x10000AFF,
  50. ENS_UNSUPPORTED_PHON_FORMAT = 0x10000BFF,
  51. ENS_NO_SPECT_FRAMES = 0x10000CFF,
  52. ENS_EMPTY_PHONEME_MANIFEST = 0x10000DFF,
  53. ENS_SPEECH_STOPPED = 0x10000EFF,
  54. /* eSpeak NG 1.49.2 */
  55. ENS_UNKNOWN_PHONEME_FEATURE = 0x10000FFF,
  56. ENS_UNKNOWN_TEXT_ENCODING = 0x100010FF,
  57. } espeak_ng_STATUS;
  58. typedef enum {
  59. ENOUTPUT_MODE_SYNCHRONOUS = 0x0001,
  60. ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
  61. } espeak_ng_OUTPUT_MODE;
  62. typedef enum {
  63. ENGENDER_UNKNOWN = 0,
  64. ENGENDER_MALE = 1,
  65. ENGENDER_FEMALE = 2,
  66. ENGENDER_NEUTRAL = 3,
  67. } espeak_ng_VOICE_GENDER;
  68. /* eSpeak NG 1.49.0 */
  69. typedef struct espeak_ng_ERROR_CONTEXT_ *espeak_ng_ERROR_CONTEXT;
  70. ESPEAK_NG_API void
  71. espeak_ng_ClearErrorContext(espeak_ng_ERROR_CONTEXT *context);
  72. ESPEAK_NG_API void
  73. espeak_ng_GetStatusCodeMessage(espeak_ng_STATUS status,
  74. char *buffer,
  75. size_t length);
  76. ESPEAK_NG_API void
  77. espeak_ng_PrintStatusCodeMessage(espeak_ng_STATUS status,
  78. FILE *out,
  79. espeak_ng_ERROR_CONTEXT context);
  80. ESPEAK_NG_API void
  81. espeak_ng_InitializePath(const char *path);
  82. ESPEAK_NG_API espeak_ng_STATUS
  83. espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *context);
  84. ESPEAK_NG_API espeak_ng_STATUS
  85. espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode,
  86. int buffer_length,
  87. const char *device);
  88. ESPEAK_NG_API int
  89. espeak_ng_GetSampleRate(void);
  90. ESPEAK_NG_API espeak_ng_STATUS
  91. espeak_ng_SetParameter(espeak_PARAMETER parameter,
  92. int value,
  93. int relative);
  94. ESPEAK_NG_API espeak_ng_STATUS
  95. espeak_ng_SetPunctuationList(const wchar_t *punctlist);
  96. ESPEAK_NG_API espeak_ng_STATUS
  97. espeak_ng_SetVoiceByName(const char *name);
  98. ESPEAK_NG_API espeak_ng_STATUS
  99. espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector);
  100. ESPEAK_NG_API espeak_ng_STATUS
  101. espeak_ng_Synthesize(const void *text,
  102. size_t size,
  103. unsigned int position,
  104. espeak_POSITION_TYPE position_type,
  105. unsigned int end_position,
  106. unsigned int flags,
  107. unsigned int *unique_identifier,
  108. void *user_data);
  109. ESPEAK_NG_API espeak_ng_STATUS
  110. espeak_ng_SynthesizeMark(const void *text,
  111. size_t size,
  112. const char *index_mark,
  113. unsigned int end_position,
  114. unsigned int flags,
  115. unsigned int *unique_identifier,
  116. void *user_data);
  117. ESPEAK_NG_API espeak_ng_STATUS
  118. espeak_ng_SpeakKeyName(const char *key_name);
  119. ESPEAK_NG_API espeak_ng_STATUS
  120. espeak_ng_SpeakCharacter(wchar_t character);
  121. ESPEAK_NG_API espeak_ng_STATUS
  122. espeak_ng_Cancel(void);
  123. ESPEAK_NG_API espeak_ng_STATUS
  124. espeak_ng_Synchronize(void);
  125. ESPEAK_NG_API espeak_ng_STATUS
  126. espeak_ng_Terminate(void);
  127. ESPEAK_NG_API espeak_ng_STATUS
  128. espeak_ng_CompileDictionary(const char *dsource,
  129. const char *dict_name,
  130. FILE *log,
  131. int flags,
  132. espeak_ng_ERROR_CONTEXT *context);
  133. ESPEAK_NG_API espeak_ng_STATUS
  134. espeak_ng_CompileMbrolaVoice(const char *path,
  135. FILE *log,
  136. espeak_ng_ERROR_CONTEXT *context);
  137. ESPEAK_NG_API espeak_ng_STATUS
  138. espeak_ng_CompilePhonemeData(long rate,
  139. FILE *log,
  140. espeak_ng_ERROR_CONTEXT *context);
  141. ESPEAK_NG_API espeak_ng_STATUS
  142. espeak_ng_CompileIntonation(FILE *log,
  143. espeak_ng_ERROR_CONTEXT *context);
  144. /* eSpeak NG 1.49.1 */
  145. ESPEAK_NG_API espeak_ng_STATUS
  146. espeak_ng_CompilePhonemeDataPath(long rate,
  147. const char *source_path,
  148. const char *destination_path,
  149. FILE *log,
  150. espeak_ng_ERROR_CONTEXT *context);
  151. /* eSpeak NG 1.49.2 */
  152. typedef enum
  153. {
  154. ESPEAKNG_ENCODING_UNKNOWN,
  155. ESPEAKNG_ENCODING_US_ASCII,
  156. ESPEAKNG_ENCODING_ISO_8859_1,
  157. ESPEAKNG_ENCODING_ISO_8859_2,
  158. ESPEAKNG_ENCODING_ISO_8859_3,
  159. } espeak_ng_ENCODING;
  160. ESPEAK_NG_API espeak_ng_ENCODING
  161. espeak_ng_EncodingFromName(const char *encoding);
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165. #endif