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.

speech.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2005 to 2007 by Jonathan Duddington
  3. * email: [email protected]
  4. * Copyright (C) 2013-2015 Reece H. Dunn
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef SPEECH_H
  20. #define SPEECH_H
  21. #include <sys/types.h>
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
  27. #define ARCH_BIG
  28. #endif
  29. #ifdef __QNX__
  30. #define NO_VARIADIC_MACROS
  31. #endif
  32. #if defined(_WIN32) || defined(_WIN64) // Windows
  33. #define PLATFORM_WINDOWS
  34. #define PATHSEP '\\'
  35. #define NO_VARIADIC_MACROS
  36. #else
  37. #define PLATFORM_POSIX
  38. #define PATHSEP '/'
  39. #define USE_NANOSLEEP
  40. #define __cdecl
  41. #endif
  42. // will look for espeak_data directory here, and also in user's home directory
  43. #ifndef PATH_ESPEAK_DATA
  44. #define PATH_ESPEAK_DATA "/usr/share/espeak-data"
  45. #endif
  46. typedef unsigned short USHORT;
  47. typedef unsigned char UCHAR;
  48. typedef double DOUBLEX;
  49. typedef struct {
  50. const char *mnem;
  51. int value;
  52. } MNEM_TAB;
  53. int LookupMnem(MNEM_TAB *table, const char *string);
  54. #ifdef PLATFORM_WINDOWS
  55. #define N_PATH_HOME 230
  56. #else
  57. #define N_PATH_HOME 160
  58. #endif
  59. extern char path_home[N_PATH_HOME]; // this is the espeak-data directory
  60. extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size);
  61. extern ESPEAK_NG_API size_t GetFileLength(const char *filename);
  62. char *Alloc(int size);
  63. void Free(void *ptr);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif // SPEECH_H