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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. } espeak_ng_STATUS;
  41. typedef enum {
  42. ENOUTPUT_MODE_SYNCHRONOUS = 0x0001,
  43. ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
  44. } espeak_ng_OUTPUT_MODE;
  45. ESPEAK_NG_API void
  46. espeak_ng_InitializePath(const char *path);
  47. ESPEAK_NG_API espeak_ng_STATUS
  48. espeak_ng_Initialize(void);
  49. ESPEAK_NG_API espeak_ng_STATUS
  50. espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode,
  51. int buffer_length,
  52. const char *device);
  53. ESPEAK_NG_API int
  54. espeak_ng_GetSampleRate(void);
  55. ESPEAK_NG_API espeak_ng_STATUS
  56. espeak_ng_Synthesize(const void *text,
  57. size_t size,
  58. unsigned int position,
  59. espeak_POSITION_TYPE position_type,
  60. unsigned int end_position,
  61. unsigned int flags,
  62. unsigned int *unique_identifier,
  63. void *user_data);
  64. ESPEAK_NG_API espeak_ng_STATUS
  65. espeak_ng_SynthesizeMark(const void *text,
  66. size_t size,
  67. const char *index_mark,
  68. unsigned int end_position,
  69. unsigned int flags,
  70. unsigned int *unique_identifier,
  71. void *user_data);
  72. ESPEAK_NG_API espeak_ng_STATUS
  73. espeak_ng_SpeakKeyName(const char *key_name);
  74. ESPEAK_NG_API espeak_ng_STATUS
  75. espeak_ng_SpeakCharacter(wchar_t character);
  76. ESPEAK_NG_API espeak_ng_STATUS
  77. espeak_ng_CompileDictionary(const char *dsource,
  78. const char *dict_name,
  79. FILE *log,
  80. int flags);
  81. ESPEAK_NG_API espeak_ng_STATUS
  82. espeak_ng_CompileMbrolaVoice(const char *path,
  83. FILE *log);
  84. ESPEAK_NG_API espeak_ng_STATUS
  85. espeak_ng_CompilePhonemeData(long rate,
  86. FILE *log);
  87. ESPEAK_NG_API espeak_ng_STATUS
  88. espeak_ng_CompileIntonation(FILE *log);
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92. #endif