1 /*************************************************************************/
3 /* Centre for Speech Technology Research */
4 /* University of Edinburgh, UK */
5 /* Copyright (c) 1996,1997 */
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 /*************************************************************************/
34 /* Author: Paul Taylor */
35 /* Date: 6 Jan 1998 */
36 /* --------------------------------------------------------------------- */
37 /* LPC residual synthesis alternative version */
39 /*************************************************************************/
41 #ifndef __US_DIPHONE_H__
42 #define __US_DIPHONE_H__
44 #include "EST_FileType.h"
45 #include "EST_TVector.h"
46 #include "EST_THash.h"
47 #include "EST_Token.h"
48 #include "ling_class/EST_Relation.h"
50 SIOD_REGISTER_CLASS_DCLS(us_db,USDiphIndex)
51 VAL_REGISTER_CLASS_DCLS(us_db,USDiphIndex)
59 EST_String index_file;
60 EST_String group_file;
61 EST_String track_file_format;
62 EST_String sig_file_format;
65 EST_TokenStream ts; // for grouped diphones
74 EST_TVector<EST_Item> diphone;
75 EST_TStringHash<int> dihash;
78 int read_diphone_database(const EST_String &filename, USDiphIndex &index);
81 void load_separate_diphone(int unit, bool keep_full,
82 const EST_String &cut_type="all");
84 int find_diphone_index(const EST_Item &d);
86 void parse_diphone_times(EST_Relation &diphone_stream,
87 EST_Relation &source_lab);
89 void us_get_diphones(EST_Utterance &utt);
91 void us_full_cut(EST_Relation &unit);
93 LISP us_check_diphone_presence(LISP name);
96 #endif // __US_DIPHONE_H__