Debian Codegraph @

3rdparty/flite_hts_engine/flite/include/flite.h

raw symbols SCIP
1 /*************************************************************************/
2 /* */
3 /* Language Technologies Institute */
4 /* Carnegie Mellon University */
5 /* Copyright (c) 1999 */
6 /* All Rights Reserved. */
7 /* */
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 */
20 /* permission. */
21 /* */
22 /* CARNEGIE MELLON UNIVERSITY 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 CARNEGIE MELLON UNIVERSITY 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 */
30 /* THIS SOFTWARE. */
31 /* */
32 /*************************************************************************/
33 /* Author: Alan W Black ([email protected]) */
34 /* Date: December 1999 */
35 /*************************************************************************/
36 /* */
37 /* Light weight run-time speech synthesis system, public API */
38 /* */
39 /*************************************************************************/
40
41 /* ----------------------------------------------------------------- */
42 /* The English TTS System "Flite+hts_engine" */
43 /* developed by HTS Working Group */
44 /* http://hts-engine.sourceforge.net/ */
45 /* ----------------------------------------------------------------- */
46 /* */
47 /* Copyright (c) 2005-2013 Nagoya Institute of Technology */
48 /* Department of Computer Science */
49 /* */
50 /* 2005-2008 Tokyo Institute of Technology */
51 /* Interdisciplinary Graduate School of */
52 /* Science and Engineering */
53 /* */
54 /* All rights reserved. */
55 /* */
56 /* Redistribution and use in source and binary forms, with or */
57 /* without modification, are permitted provided that the following */
58 /* conditions are met: */
59 /* */
60 /* - Redistributions of source code must retain the above copyright */
61 /* notice, this list of conditions and the following disclaimer. */
62 /* - Redistributions in binary form must reproduce the above */
63 /* copyright notice, this list of conditions and the following */
64 /* disclaimer in the documentation and/or other materials provided */
65 /* with the distribution. */
66 /* - Neither the name of the HTS working group nor the names of its */
67 /* contributors may be used to endorse or promote products derived */
68 /* from this software without specific prior written permission. */
69 /* */
70 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
71 /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
72 /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
73 /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
74 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
75 /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
76 /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
77 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
78 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
79 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
80 /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
81 /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
82 /* POSSIBILITY OF SUCH DAMAGE. */
83 /* ----------------------------------------------------------------- */
84
85 #ifndef _FLITE_H__
86 #define _FLITE_H__
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif /* __cplusplus */
91
92 #include "cst_string.h"
93 #include "cst_regex.h"
94 #include "cst_val.h"
95 #include "cst_features.h"
96 #include "cst_item.h"
97 #include "cst_relation.h"
98 #include "cst_utterance.h"
99 #include "cst_wave.h"
100 #include "cst_track.h"
101
102 #include "cst_cart.h"
103 #include "cst_phoneset.h"
104 #include "cst_voice.h"
105 #include "cst_audio.h"
106
107 #include "cst_utt_utils.h"
108 #include "cst_lexicon.h"
109 #include "cst_synth.h"
110 #ifndef FLITE_PLUS_HTS_ENGINE
111 #include "cst_units.h"
112 #endif /* !FLITE_PLUS_HTS_ENGINE */
113 #include "cst_tokenstream.h"
114
115 extern cst_val *flite_voice_list;
116
117 /* Public functions */
118 int flite_init();
119
120 /* General top level functions */
121 cst_voice *flite_voice_select(const char *name);
122 float flite_file_to_speech(const char *filename,
123 cst_voice *voice,
124 const char *outtype);
125 float flite_text_to_speech(const char *text,
126 cst_voice *voice,
127 const char *outtype);
128 float flite_phones_to_speech(const char *text,
129 cst_voice *voice,
130 const char *outtype);
131 float flite_ssml_to_speech(const char *filename,
132 cst_voice *voice,
133 const char *outtype);
134 int flite_voice_add_lex_addenda(cst_voice *v, const cst_string *lexfile);
135
136 /* Lower lever user functions */
137 cst_wave *flite_text_to_wave(const char *text,cst_voice *voice);
138 cst_utterance *flite_synth_text(const char *text,cst_voice *voice);
139 cst_utterance *flite_synth_phones(const char *phones,cst_voice *voice);
140
141 cst_utterance *flite_do_synth(cst_utterance *u,
142 cst_voice *voice,
143 cst_uttfunc synth);
144 float flite_process_output(cst_utterance *u,
145 const char *outtype,
146 int append);
147
148 /* flite public export wrappers for features access */
149 int flite_get_param_int(const cst_features *f, const char *name,int def);
150 float flite_get_param_float(const cst_features *f, const char *name, float def);
151 const char *flite_get_param_string(const cst_features *f, const char *name, const char *def);
152 const cst_val *flite_get_param_val(const cst_features *f, const char *name, cst_val *def);
153 void flite_feat_set_int(cst_features *f, const char *name, int v);
154 void flite_feat_set_float(cst_features *f, const char *name, float v);
155 void flite_feat_set_string(cst_features *f, const char *name, const char *v);
156 void flite_feat_set(cst_features *f, const char *name,const cst_val *v);
157 int flite_feat_remove(cst_features *f, const char *name);
158
159 const char *flite_ffeature_string(const cst_item *item,const char *featpath);
160 int flite_ffeature_int(const cst_item *item,const char *featpath);
161 float flite_ffeature_float(const cst_item *item,const char *featpath);
162 const cst_val *flite_ffeature(const cst_item *item,const char *featpath);
163 cst_item* flite_path_to_item(const cst_item *item,const char *featpath);
164
165 #ifdef __cplusplus
166 } /* extern "C" */
167 #endif /* __cplusplus */
168
169
170 #endif