Edinburgh Speech Tools  2.1-release
EST_TrackFile.h
Go to the documentation of this file.
1  /************************************************************************/
2  /* */
3  /* Centre for Speech Technology Research */
4  /* University of Edinburgh, UK */
5  /* Copyright (c) 1996,1997 */
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  /* 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 */
30  /* THIS SOFTWARE. */
31  /* */
32  /*************************************************************************/
33  /* */
34  /* Author: Richard Caley (rjc@cstr.ed.ac.uk) */
35  /* Date: Fri Nov 14 1997 */
36  /* -------------------------------------------------------------------- */
37  /* Track file formats known to the speech tools. */
38  /* */
39  /*************************************************************************/
40 
41 #ifndef __EST_TRACKFILE_H__
42 #define __EST_TRACKFILE_H__
43 
44 #include "EST_Token.h"
45 #include "EST_TNamedEnum.h"
46 #include "EST_Track.h"
47 #include "EST_String.h"
48 #include "EST_rw_status.h"
49 #include "htk.h"
50 #include "ssff.h"
51 
53 
54 public:
55 
56  // We have to use #defines for what should be done with just
57  // typedefs because Sun CC thinks you shouldn't be allowed to
58  // declare a member function via a typedef.
59 
60 #define LoadTrackFileArgs const EST_String filename, \
61  EST_Track &tr, float ishift, float startt
62 
63 #define SaveTrackFileArgs const EST_String filename, EST_Track& tr
64 
65 #define LoadTrack_TokenStreamArgs EST_TokenStream &ts, \
66  EST_Track &tr, float ishift, float startt
67 
68 #define SaveTrac_TokenStreamArgs FILE *fp, EST_Track& tr
69 
72 
74 
76 
77  typedef struct Info {
78  bool recognise;
81  const char *description;
82  } Info;
83 
84  typedef struct TS_Info {
85  bool recognise;
88  const char *description;
89  } TS_Info;
90 
93 
96 
99 
102 
105 
108 
111 
114 
116 
119 
122 
125 
128 
131 
134 
137 
140 
143 
146 
149 
150  static EST_String options_supported(void);
151  static EST_String options_short(void);
152 };
153 
154 int track_to_espsf0(EST_Track &track, EST_Track &fz);
155 int espsf0_to_track(EST_Track &fz);
156 
157 int track_to_htk_lpc(EST_Track &track, EST_Track &lpc);
158 
159 EST_write_status put_esps(const char *filename, const char *style, float *t, float *a,
160  int *v, float fsize, float rate, int num_points);
161 
162 enum EST_write_status put_track_esps(const char *filename, char **f_names,
163  float **a, float fsize, float rate,
164  int order, int num_points,
165  short fixed);
166 
167 EST_read_status get_esps(const char *filename, const char *style,
168  float **t, float **a, int **v, float *fsize, int *num_points);
169 
170 EST_read_status get_track_esps(const char *filename, char ***fields, float
171  ***a, float *fsize, int *num_points, int *num_fields,
172  short *fixed);
173 
174 #endif
static EST_write_status save_est(SaveTrackFileArgs)
static EST_read_status load_xmg(LoadTrackFileArgs)
static EST_write_status save_htk_user(SaveTrackFileArgs)
static EST_TNamedEnumI< EST_TrackFileType, TS_Info > ts_map
static EST_write_status save_est_ascii(SaveTrackFileArgs)
EST_write_status
static EST_read_status load_NIST(LoadTrackFileArgs)
static EST_write_status save_est_binary_ts(SaveTrac_TokenStreamArgs)
int track_to_espsf0(EST_Track &track, EST_Track &fz)
Load_File * load
Definition: EST_TrackFile.h:79
enum EST_write_status put_track_esps(const char *filename, char **f_names, float **a, float fsize, float rate, int order, int num_points, short fixed)
Definition: esps_io.cc:125
static EST_write_status save_est_ts(SaveTrac_TokenStreamArgs)
static EST_read_status load_ascii(LoadTrackFileArgs)
static EST_write_status save_ssff_ts(SaveTrac_TokenStreamArgs)
Definition: ssff.cc:250
#define LoadTrackFileArgs
Definition: EST_TrackFile.h:60
EST_read_status Load_File(LoadTrackFileArgs)
Definition: EST_TrackFile.h:70
const char * description
Definition: EST_TrackFile.h:88
static EST_read_status load_esps(LoadTrackFileArgs)
static EST_String options_short(void)
int track_to_htk_lpc(EST_Track &track, EST_Track &lpc)
static EST_write_status save_htk_fbank(SaveTrackFileArgs)
bool recognise
Definition: EST_TrackFile.h:85
EST_read_status get_esps(const char *filename, const char *style, float **t, float **a, int **v, float *fsize, int *num_points)
EST_write_status Save_TokenStream(SaveTrac_TokenStreamArgs)
Definition: EST_TrackFile.h:75
EST_read_status get_track_esps(const char *filename, char ***fields, float ***a, float *fsize, int *num_points, int *num_fields, short *fixed)
Definition: esps_io.cc:272
EST_write_status put_esps(const char *filename, const char *style, float *t, float *a, int *v, float fsize, float rate, int num_points)
Definition: esps_io.cc:55
#define LoadTrack_TokenStreamArgs
Definition: EST_TrackFile.h:65
static EST_read_status load_ssff_ts(LoadTrack_TokenStreamArgs)
Definition: ssff.cc:75
Save_TokenStream * save
Definition: EST_TrackFile.h:87
static EST_write_status save_esps(SaveTrackFileArgs)
static EST_read_status load_htk_discrete(LoadTrackFileArgs)
static EST_write_status save_ema_swapped(SaveTrackFileArgs)
static EST_read_status load_ema_swapped(LoadTrackFileArgs)
static EST_read_status load_htk(LoadTrackFileArgs)
static EST_TNamedEnumI< EST_TrackFileType, Info > map
static EST_read_status load_htk_user(LoadTrackFileArgs)
static EST_write_status save_htk_mfcc_e(SaveTrackFileArgs)
static EST_write_status save_NIST(SaveTrackFileArgs)
EST_read_status Load_TokenStream(LoadTrack_TokenStreamArgs)
Definition: EST_TrackFile.h:73
static EST_read_status load_htk_mfcc(LoadTrackFileArgs)
#define SaveTrac_TokenStreamArgs
Definition: EST_TrackFile.h:68
Save_File * save
Definition: EST_TrackFile.h:80
Load_TokenStream * load
Definition: EST_TrackFile.h:86
EST_read_status
static EST_read_status load_est(LoadTrackFileArgs)
static EST_write_status save_htk_discrete(SaveTrackFileArgs)
EST_write_status Save_File(SaveTrackFileArgs)
Definition: EST_TrackFile.h:71
static EST_write_status save_htk(SaveTrackFileArgs)
static EST_read_status load_xgraph(LoadTrackFileArgs)
static EST_write_status save_xmg(SaveTrackFileArgs)
#define SaveTrackFileArgs
Definition: EST_TrackFile.h:63
static EST_write_status save_ssff(SaveTrackFileArgs)
Definition: ssff.cc:232
static EST_write_status save_est_binary(SaveTrackFileArgs)
static EST_read_status load_est_ascii(LoadTrackFileArgs)
static EST_write_status save_xgraph(SaveTrackFileArgs)
static EST_write_status save_ascii(SaveTrackFileArgs)
static EST_read_status load_ssff(LoadTrackFileArgs)
Definition: ssff.cc:61
static EST_read_status load_htk_fbank(LoadTrackFileArgs)
int espsf0_to_track(EST_Track &fz)
static EST_read_status load_est_ts(LoadTrack_TokenStreamArgs)
static EST_write_status save_ema(SaveTrackFileArgs)
static EST_write_status save_htk_mfcc(SaveTrackFileArgs)
static EST_String options_supported(void)
static EST_read_status load_ema(LoadTrackFileArgs)