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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /***************************************************************************
  2. * Copyright (C) 2005 to 2007 by Jonathan Duddington *
  3. * email: [email protected] *
  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, write see: *
  17. * <http://www.gnu.org/licenses/>. *
  18. ***************************************************************************/
  19. #include <sys/types.h>
  20. // conditional compilation options
  21. #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
  22. #define ARCH_BIG
  23. #endif
  24. #define PLATFORM_POSIX
  25. #define PATHSEP '/'
  26. #define USE_PORTAUDIO
  27. #define USE_NANOSLEEP
  28. #define __cdecl
  29. #define ESPEAK_API extern "C"
  30. #ifdef LIBRARY
  31. #define USE_ASYNC
  32. //#define USE_MBROLA_LIB
  33. #endif
  34. #ifdef _ESPEAKEDIT
  35. #define USE_ASYNC
  36. #define LOG_FRAMES // write keyframe info to log-espeakedit
  37. #endif
  38. // will look for espeak_data directory here, and also in user's home directory
  39. #ifndef PATH_ESPEAK_DATA
  40. #define PATH_ESPEAK_DATA "/usr/share/espeak-data"
  41. #endif
  42. typedef unsigned short USHORT;
  43. typedef unsigned char UCHAR;
  44. typedef double DOUBLEX;
  45. #define N_PEAKS 9
  46. #define N_MARKERS 8
  47. typedef struct {
  48. const char *mnem;
  49. int value;
  50. } MNEM_TAB;
  51. int LookupMnem(MNEM_TAB *table, char *string);
  52. typedef struct {
  53. short pkfreq;
  54. short pkheight;
  55. short pkwidth;
  56. short pkright;
  57. } peak_t;
  58. typedef struct {
  59. short frflags;
  60. unsigned char length;
  61. unsigned char rms;
  62. short ffreq[9];
  63. unsigned char fheight[9];
  64. unsigned char fwidth[6]; // width/4
  65. unsigned char fright[6]; // width/4
  66. } frame_t;
  67. int GetFileLength(const char *filename);
  68. char *Alloc(int size);
  69. void Free(void *ptr);
  70. #define N_PATH_HOME 120
  71. extern char path_home[N_PATH_HOME]; // this is the espeak-data directory
  72. extern const char *version_string;
  73. extern const int version_phdata;
  74. extern void strncpy0(char *to,const char *from, int size);