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 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* eSpeak NG API.
  2. *
  3. * Copyright (C) 2015-2016 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 "speak_lib.h"
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. #ifdef __WIN32__
  26. #define ESPEAK_NG_API __declspec(dllexport)
  27. #else
  28. #define ESPEAK_NG_API
  29. #endif
  30. typedef enum {
  31. ENS_GROUP_MASK = 0x70000000,
  32. ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */
  33. ENS_GROUP_ESPEAK_NG = 0x10000000, /* eSpeak NG error codes. */
  34. ENS_OK = 0,
  35. ENS_COMPILE_ERROR = 0x100001FF,
  36. ENS_VERSION_MISMATCH = 0x100002FF,
  37. ENS_FIFO_BUFFER_FULL = 0x100003FF,
  38. ENS_NOT_INITIALIZED = 0x100004FF,
  39. ENS_AUDIO_ERROR = 0x100005FF,
  40. ENS_VOICE_NOT_FOUND = 0x100006FF,
  41. ENS_MBROLA_NOT_FOUND = 0x100007FF,
  42. ENS_MBROLA_VOICE_NOT_FOUND = 0x100008FF,
  43. ENS_EVENT_BUFFER_FULL = 0x100009FF,
  44. ENS_NOT_SUPPORTED = 0x10000AFF,
  45. ENS_UNSUPPORTED_PHON_FORMAT = 0x10000BFF,
  46. ENS_NO_SPECT_FRAMES = 0x10000CFF,
  47. } espeak_ng_STATUS;
  48. typedef enum {
  49. ENOUTPUT_MODE_SYNCHRONOUS = 0x0001,
  50. ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
  51. } espeak_ng_OUTPUT_MODE;
  52. ESPEAK_NG_API void
  53. espeak_ng_GetStatusCodeMessage(espeak_ng_STATUS status,
  54. char *buffer,
  55. size_t length);
  56. ESPEAK_NG_API void
  57. espeak_ng_PrintStatusCodeMessage(espeak_ng_STATUS status,
  58. FILE *out);
  59. ESPEAK_NG_API void
  60. espeak_ng_InitializePath(const char *path);
  61. ESPEAK_NG_API espeak_ng_STATUS
  62. espeak_ng_Initialize(void);
  63. ESPEAK_NG_API espeak_ng_STATUS
  64. espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode,
  65. int buffer_length,
  66. const char *device);
  67. ESPEAK_NG_API int
  68. espeak_ng_GetSampleRate(void);
  69. ESPEAK_NG_API espeak_ng_STATUS
  70. espeak_ng_SetParameter(espeak_PARAMETER parameter,
  71. int value,
  72. int relative);
  73. ESPEAK_NG_API espeak_ng_STATUS
  74. espeak_ng_SetPunctuationList(const wchar_t *punctlist);
  75. ESPEAK_NG_API espeak_ng_STATUS
  76. espeak_ng_SetVoiceByName(const char *name);
  77. ESPEAK_NG_API espeak_ng_STATUS
  78. espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector);
  79. ESPEAK_NG_API espeak_ng_STATUS
  80. espeak_ng_Synthesize(const void *text,
  81. size_t size,
  82. unsigned int position,
  83. espeak_POSITION_TYPE position_type,
  84. unsigned int end_position,
  85. unsigned int flags,
  86. unsigned int *unique_identifier,
  87. void *user_data);
  88. ESPEAK_NG_API espeak_ng_STATUS
  89. espeak_ng_SynthesizeMark(const void *text,
  90. size_t size,
  91. const char *index_mark,
  92. unsigned int end_position,
  93. unsigned int flags,
  94. unsigned int *unique_identifier,
  95. void *user_data);
  96. ESPEAK_NG_API espeak_ng_STATUS
  97. espeak_ng_SpeakKeyName(const char *key_name);
  98. ESPEAK_NG_API espeak_ng_STATUS
  99. espeak_ng_SpeakCharacter(wchar_t character);
  100. ESPEAK_NG_API espeak_ng_STATUS
  101. espeak_ng_Cancel(void);
  102. ESPEAK_NG_API espeak_ng_STATUS
  103. espeak_ng_Synchronize(void);
  104. ESPEAK_NG_API espeak_ng_STATUS
  105. espeak_ng_Terminate(void);
  106. ESPEAK_NG_API espeak_ng_STATUS
  107. espeak_ng_CompileDictionary(const char *dsource,
  108. const char *dict_name,
  109. FILE *log,
  110. int flags);
  111. ESPEAK_NG_API espeak_ng_STATUS
  112. espeak_ng_CompileMbrolaVoice(const char *path,
  113. FILE *log);
  114. ESPEAK_NG_API espeak_ng_STATUS
  115. espeak_ng_CompilePhonemeData(long rate,
  116. FILE *log);
  117. ESPEAK_NG_API espeak_ng_STATUS
  118. espeak_ng_CompileIntonation(FILE *log);
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122. #endif