1 /*************************************************************************/
3 /* Centre for Speech Technology Research */
4 /* University of Edinburgh, UK */
5 /* Copyright (c) 1999 */
6 /* All Rights Reserved. */
8 /* Permission is hereby granted, free of charge, to use and distribute */
9 /* this software and its documentation without restriction, including */
10 /* without limitation the rights to use, copy, modify, merge, publish, */
11 /* distribute, sublicense, and/or sell copies of this work, and to */
12 /* permit persons to whom this work is furnished to do so, subject to */
13 /* the following conditions: */
14 /* 1. The code must retain the above copyright notice, this list of */
15 /* conditions and the following disclaimer. */
16 /* 2. Any modifications must be clearly marked as such. */
17 /* 3. Original authors' names are not deleted. */
18 /* 4. The authors' names are not used to endorse or promote products */
19 /* derived from this software without specific prior written */
22 /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25 /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
32 /*************************************************************************/
33 /* Author : Alan W Black (awb@cstr.ed.ac.uk) */
34 /* Date : March 1999 */
35 /*-----------------------------------------------------------------------*/
37 /* Client end of Festival server API (in C) designed specifically for */
38 /* Galaxy Communicator use, though might be of use for other things */
40 /*=======================================================================*/
41 #ifndef _FESTIVAL_CLIENT_H_
42 #define _FESTIVAL_CLIENT_H_
44 #define FESTIVAL_DEFAULT_SERVER_HOST "localhost"
45 #define FESTIVAL_DEFAULT_SERVER_PORT 1314
46 #define FESTIVAL_DEFAULT_TEXT_MODE "fundamental"
48 typedef struct FT_Info
58 typedef struct FT_Wave
65 void delete_FT_Wave(FT_Wave *wave);
66 void delete_FT_Info(FT_Info *info);
68 #define SWAPSHORT(x) ((((unsigned)x) & 0xff) << 8 | \
69 (((unsigned)x) & 0xff00) >> 8)
70 #define SWAPINT(x) ((((unsigned)x) & 0xff) << 24 | \
71 (((unsigned)x) & 0xff00) << 8 | \
72 (((unsigned)x) & 0xff0000) >> 8 | \
73 (((unsigned)x) & 0xff000000) >> 24)
75 /* Sun, HP, SGI Mips, M68000 */
76 #define FAPI_BIG_ENDIAN (((char *)&fapi_endian_loc)[0] == 0)
77 /* Intel, Alpha, DEC Mips, Vax */
78 #define FAPI_LITTLE_ENDIAN (((char *)&fapi_endian_loc)[0] != 0)
81 /*****************************************************************/
82 /* Public functions to interface */
83 /*****************************************************************/
85 /* If called with NULL will attempt to access using defaults */
86 FT_Info *festivalOpen(FT_Info *info);
87 FT_Wave *festivalStringToWave(FT_Info *info,char *text);
88 int festivalClose(FT_Info *info);