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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 NEED_GETOPT
  31. #define NO_VARIADIC_MACROS
  32. #endif
  33. #if defined(_WIN32) || defined(_WIN64) // Windows
  34. #define PLATFORM_WINDOWS
  35. #define PATHSEP '\\'
  36. #define NEED_GETOPT
  37. #define NO_VARIADIC_MACROS
  38. #else
  39. #define PLATFORM_POSIX
  40. #define PATHSEP '/'
  41. #define USE_NANOSLEEP
  42. #define __cdecl
  43. #endif
  44. // will look for espeak_data directory here, and also in user's home directory
  45. #ifndef PATH_ESPEAK_DATA
  46. #define PATH_ESPEAK_DATA "/usr/share/espeak-data"
  47. #endif
  48. typedef unsigned short USHORT;
  49. typedef unsigned char UCHAR;
  50. typedef double DOUBLEX;
  51. #if !HAVE_STDINT_H
  52. #ifdef _WIN64
  53. typedef signed __int64 intptr_t;
  54. #else
  55. typedef signed __int32 intptr_t;
  56. #endif
  57. #endif
  58. typedef struct {
  59. const char *mnem;
  60. int value;
  61. } MNEM_TAB;
  62. int LookupMnem(MNEM_TAB *table, const char *string);
  63. #ifdef PLATFORM_WINDOWS
  64. #define N_PATH_HOME 230
  65. #else
  66. #define N_PATH_HOME 160
  67. #endif
  68. extern char path_home[N_PATH_HOME]; // this is the espeak-data directory
  69. extern void strncpy0(char *to, const char *from, int size);
  70. int GetFileLength(const char *filename);
  71. char *Alloc(int size);
  72. void Free(void *ptr);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif // SPEECH_H