47#include "EST_track_aux.h"
48#include "EST_TrackMap.h"
49#include "EST_cutils.h"
52#include "EST_string_aux.h"
53#include "EST_walloc.h"
54#include "EST_TrackFile.h"
55#include "EST_FileType.h"
56#include "EST_WaveFile.h"
57#include "EST_wave_utils.h"
62#define NEARLY_ZERO 0.00001
64#define REASONABLE_FRAME_SIZE (20)
65#define UNREASONABLE_FRAME_SIZE (80)
68static const char *NIST_SIG =
"NIST_1A\n 1024\n";
69static const char *NIST_END_SIG =
"end_head\n";
70#define NIST_HDR_SIZE 1024
72static int def_load_sample_rate = 500;
78int nist_get_param_int(
char *
hdr,
char *field,
int def_val);
79char *nist_get_param_str(
char *
hdr,
char *field,
char *def_val);
80const char *sample_type_to_nist(
enum EST_sample_type_t sample_type);
81enum EST_sample_type_t nist_to_sample_type(
char *type);
84 bool &
ascii, EST_EstFileType &t);
96 EST_read_status
r_val;
102 if (
r_val == misc_read_error)
104 cerr <<
"Error reading ESPS file " << filename <<
endl;
105 return misc_read_error;
107 else if (
r_val == wrong_format)
122 for (
j = 0;
j < num_fields; ++
j)
129 for (i = 0; i < num_fields; ++i)
134 tr.set_single_break(
false);
135 tr.set_equal_space(
true);
145 tr.set_file_type(tff_esps);
146 tr.set_name(filename);
148 if (
tr.channel_name(0) ==
"F0")
165 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
167 cerr <<
"Can't open track file " << filename <<
endl;
168 return misc_read_error;
171 ts.set_SingleCharSymbols(
";");
176 "Error: Frame spacing must be specified (or apparent frame shift nearly zero)\n";
177 return misc_read_error;
183 sl.append(
ts.get_upto_eoln().string());
187 tt.open_string(
sl.first());
195 for (p =
sl.head(), i = 0; p != 0; ++i, p = p->next())
198 tt.open_string(
sl(p));
199 for (
j = 0; !
tt.eof(); ++
j)
200 tr.a(i,
j) =
tt.get().Float(
ok);
203 cerr <<
"Wrong number of points in row " << i <<
endl;
205 return misc_read_error;
210 tr.set_single_break(FALSE);
211 tr.set_equal_space(TRUE);
212 tr.set_file_type(tff_ascii);
213 tr.set_name(filename);
230 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
232 cerr <<
"Can't open track file " << filename <<
endl;
233 return misc_read_error;
236 ts.set_SingleCharSymbols(
";");
241 sl.append(
ts.get_upto_eoln().string());
243 tt.open_string(
sl.first());
252 for (p =
sl.head(), i = 0; p != 0; ++i, p = p->next())
255 tt.open_string(
sl(p));
256 tr.t(i) =
tt.get().Float(
ok);
257 for (
j = 0; !
tt.eof(); ++
j)
258 tr.a(i,
j) =
tt.get().Float(
ok);
261 cerr <<
"Wrong number of points in row " << i <<
endl;
263 return misc_read_error;
267 tr.set_single_break(FALSE);
268 tr.set_equal_space(TRUE);
269 tr.set_file_type(tff_xgraph);
270 tr.set_name(filename);
286 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
288 cerr <<
"Can't open track file " << filename <<
endl;
289 return misc_read_error;
292 ts.set_SingleCharSymbols(
";");
294 if (
ts.peek().string() !=
"XAO1")
299 while ((!
ts.eof()) && (
ts.peek().string() !=
"\014"))
301 k =
ts.get().string();
302 v =
ts.get().string();
307 else if (k ==
"YMin")
309 else if (k ==
"YMax")
316 cerr <<
"Unexpected end of file in reading xmg header\n";
317 return misc_read_error;
320 ts.get_upto_eoln().string();
323 for (n = 0; !
ts.eof(); ++n)
324 sl.append(
ts.get_upto_eoln().string());
329 for (p =
sl.head(), i = 0; p != 0; ++i, p = p->next())
332 ts.open_string(
sl(p));
333 if (
ts.peek().string() !=
"=")
335 tr.t(i) =
ts.get().Float(
ok) / 1000.0;
336 tr.a(i) =
ts.get().Float(
ok);
345 tr.set_single_break(TRUE);
346 tr.set_equal_space(FALSE);
347 tr.set_file_type(tff_xmg);
348 tr.set_name(filename);
353EST_read_status EST_TrackFile::load_est(
const EST_String filename,
359 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
361 cerr <<
"Can't open track file " << filename <<
endl;
362 return misc_read_error;
365 ts.set_SingleCharSymbols(
";");
366 tr.set_name(filename);
369 if ((r == format_ok) && (!
ts.eof()))
371 cerr <<
"Not end of file, but expected it\n";
372 return misc_read_error;
382 if (
swap) swapfloat(&f);
392 int num_frames, num_channels;
402 if ((r = read_est_header(
ts,
hinfo,
ascii, t)) != format_ok)
404 if (t != est_file_track)
405 return misc_read_error;
409 if ((
hinfo.present(
"EqualSpace")) &&
410 ((
hinfo.S(
"EqualSpace") ==
"true") ||
411 (
hinfo.S(
"EqualSpace") ==
"1")))
414 num_frames =
hinfo.I(
"NumFrames");
415 num_channels =
hinfo.I(
"NumChannels");
416 tr.resize(num_frames, num_channels);
418 hinfo.remove(
"NumFrames");
419 hinfo.remove(
"EqualSpace");
420 hinfo.remove(
"NumChannels");
421 hinfo.remove(
"BreaksPresent");
422 hinfo.remove(
"DataType");
433 if (c->
k.contains(
"Channel_"))
435 tr.set_channel_name(c->
v.String(),
436 c->
k.after(
"Channel_").Int());
447 if (!
hinfo.present(
"ByteOrder"))
449 else if (((
hinfo.S(
"ByteOrder") ==
"01") ? bo_little : bo_big)
461 frame =
new float[num_channels];
467 for (i = 0; i < num_frames; ++i)
476 cerr <<
"unexpected end of file when looking for " << num_frames-i <<
" more frame(s)" <<
endl;
477 return misc_read_error;
479 tr.t(i) =
ts.get().Float(
ok);
481 return misc_read_error;
491 v =
ts.get().string();
499 if (get_float(
ts,
swap) == 0.0)
522 for (
j = 0;
j < num_channels; ++
j){
523 tr.a(i,
j) =
ts.get().Float(
ok);
525 return misc_read_error;
529 ts.fread( frame,
sizeof(
float), num_channels );
531 for(
j=0;
j<num_channels; ++
j ){
532 swapfloat( &frame[
j] );
533 tr.a(i,
j) = frame[
j];
536 for(
j=0;
j<num_channels; ++
j )
537 tr.a(i,
j) = frame[
j];
542 for (
j = 0;
j <
tr.num_aux_channels(); ++
j)
546 tr.aux(i,
j) =
ts.get().string();
548 return misc_read_error;
552 cerr <<
"Warning: Aux Channel reading not yet implemented";
553 cerr <<
"for binary tracks\n";
565 tr.set_single_break(FALSE);
569 tr.set_file_type(tff_est_ascii);
571 tr.set_file_type(tff_est_binary);
589 "Error: Frame spacing must be specified (or apparent frame shift nearly zero)\n";
590 return misc_read_error;
593 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
595 cerr <<
"Can't open track file " << filename <<
endl;
596 return misc_read_error;
599 if (
ts.get().string() !=
"SNNS")
601 if (
ts.get().string() !=
"result")
607 int num_frames=0, num_channels=0;
614 if (t.
contains(
"teaching output included"))
621 if (k ==
"No. of output units")
622 num_channels = v.Int();
623 if (k ==
"No. of patterns")
624 num_frames = v.Int();
632 tr.resize(num_frames, num_channels);
636 for (i = 0; (!
ts.eof()) && (i < num_frames);)
639 if (
ts.peek().string().contains(
"#"))
645 for (
j = 0;
j < num_channels; ++
j)
652 for (
j = 0;
j < num_channels; ++
j)
653 tr.a(i,
j) =
ts.get().Float(
ok);
659 tr.set_single_break(FALSE);
660 tr.set_equal_space(TRUE);
661 tr.set_file_type(tff_snns);
662 tr.set_name(filename);
679 cerr <<
"Output to stdout not available for ESPS file types:";
680 cerr <<
"no output written\n";
686 shift = EST_Track::default_frame_shift;
715 f_names[0] = wstrdup(
"EST_TIME");
737 fprintf(fp,
"EST_File Track\n");
738 fprintf(fp,
"DataType ascii\n");
739 fprintf(fp,
"NumFrames %d\n",
tr.num_frames());
740 fprintf(fp,
"NumChannels %d\n",
tr.num_channels());
741 fprintf(fp,
"NumAuxChannels %d\n",
tr.num_aux_channels());
742 fprintf(fp,
"EqualSpace %d\n",
tr.equal_space());
744 fprintf(fp,
"BreaksPresent true\n");
745 for (i = 0; i <
tr.num_channels(); ++i)
746 fprintf(fp,
"Channel_%d %s\n", i, (
const char *)(
tr.channel_name(i)));
748 for (i = 0; i <
tr.num_aux_channels(); ++i)
749 fprintf(fp,
"Aux_Channel_%d %s\n", i,
750 (
const char *)(
tr.aux_channel_name(i)));
754 for (p.begin(
tr); p; ++p)
755 fprintf(fp,
"%s %s\n", (
const char *)p->
k,
756 (
const char *) p->
v.String());
758 fprintf(fp,
"EST_Header_End\n");
760 for (i = 0; i <
tr.num_frames(); ++i)
763 fprintf(fp,
"%s\t", (
char *)(
tr.val(i) ?
"1 " :
"0 "));
764 for (
j = 0;
j <
tr.num_channels(); ++
j)
766 for (
j = 0;
j <
tr.num_aux_channels(); ++
j)
767 fprintf(fp,
"%s ", (
const char *)
tr.aux(i,
j).string());
773EST_write_status EST_TrackFile::save_est_ascii(
const EST_String filename,
781 else if ((fd =
fopen(filename,
"wb")) == NULL)
784 r = save_est_ts(fd,
tr);
798 else if ((fd =
fopen(filename,
"wb")) == NULL)
801 r = save_est_binary_ts(fd,
tr);
809EST_write_status EST_TrackFile::save_est_binary_ts(
FILE *fp,
EST_Track tr)
816 fprintf(fp,
"EST_File Track\n");
817 fprintf(fp,
"DataType binary\n");
818 fprintf(fp,
"ByteOrder %s\n", ((EST_NATIVE_BO == bo_big) ?
"10" :
"01"));
819 fprintf(fp,
"NumFrames %d\n",
tr.num_frames());
820 fprintf(fp,
"NumChannels %d\n",
tr.num_channels());
821 fprintf(fp,
"EqualSpace %d\n",
tr.equal_space());
823 fprintf(fp,
"BreaksPresent true\n");
824 fprintf(fp,
"CommentChar ;\n\n");
825 for (i = 0; i <
tr.num_channels(); ++i)
826 fprintf(fp,
"Channel_%d %s\n",i,
tr.channel_name(i).str());
827 fprintf(fp,
"EST_Header_End\n");
829 for (i = 0; i <
tr.num_frames(); ++i)
832 if((
int)
fwrite(&
tr.t(i),4,1,fp) != 1)
833 return misc_write_error;
838 float bm = (
tr.val(i) ? 1 : 0);
840 return misc_write_error;
843 for (
j = 0;
j <
tr.num_channels(); ++
j)
844 if((
int)
fwrite(&
tr.a_no_check(i,
j),4,1,fp) != 1)
845 return misc_write_error;
857 if (
tr.equal_space() == TRUE)
858 tr.change_type(0.0, FALSE);
870 outf->setf(ios::fixed, ios::floatfield);
873 for (
int i = 0; i <
tr.num_frames(); ++i)
875 for (
int j = 0;
j <
tr.num_channels(); ++
j)
902 tr.change_type(0.0, TRUE);
904 for (
int j = 0;
j <
tr.num_channels(); ++
j)
906 *
outf <<
"\""<<
tr.channel_name(
j) <<
"\"\n";
907 for (
int i = 0; i <
tr.num_frames(); ++i)
919EST_write_status save_snns_pat(
const EST_String filename,
938 *
outf <<
"SNNS pattern definition file V3.2\n";
959 cerr <<
"Error: Input pattern has " <<
inpat(
pi).num_frames()
960 <<
" output pattern has " <<
outpat(
pi).num_frames() <<
endl;
963 return misc_write_error;
965 for (i = 0; i <
inpat(
pi).num_frames(); ++i)
968 *
outf <<
"#Input pattern " << (i + 1) <<
":\n";
969 for (
j = 0;
j <
inpat(
pi).num_channels(); ++
j)
972 *
outf <<
"#Output pattern " << (i + 1) <<
":\n";
1042 tr.change_type(0.0, TRUE);
1044 if (filename ==
"-")
1053 outf->setf(ios::fixed, ios::floatfield);
1063 *
outf <<
"XAO1\n\n";
1064 *
outf <<
"LineType segments \n";
1065 *
outf <<
"LineStyle solid \n";
1066 *
outf <<
"LineWidth 0 \n";
1068 *
outf <<
"Format Binary \n";
1078 for (i = 0; i <
tr.num_frames(); ++i)
1081 *
outf <<
tr.ms_t(i) <<
"\t";
1082 for (
j = 0;
j <
tr.num_channels(); ++
j)
1094static EST_write_status save_htk_as(
const EST_String filename,
1110 if (
orig.f_String(
"contour_type",
"none") ==
"ct_lpc")
1118 if (
track.equal_space() != TRUE)
1120 track.change_type(0.0, FALSE);
1121 s = rint((HTK_UNITS_PER_SECOND * EST_Track::default_frame_shift/1000.0)/10.0) * 10.0;
1127 track.change_type(0.0, FALSE);
1128 s = rint((HTK_UNITS_PER_SECOND *
track.shift())/10.0) * 10.0;
1138 header.num_samps = (EST_BIG_ENDIAN ?
track.num_frames()
1139 : SWAPINT(
track.num_frames()));
1142 header.samp_period = (EST_BIG_ENDIAN ? (
long) s : SWAPINT((
long) s));
1144 header.samp_size = (EST_BIG_ENDIAN ?
sizeof(
short) :
1150 header.samp_type = EST_BIG_ENDIAN ? type : SWAPSHORT(type);
1154 if (filename ==
"-")
1156 else if ((
outf =
fopen(filename,
"wb")) == NULL)
1158 cerr <<
"save_htk: cannot open file \"" << filename <<
1159 "\" for writing." <<
endl;
1160 return misc_write_error;
1172 if(
track.num_channels() < 1)
1174 cerr <<
"No data to write as HTK_DISCRETE !" <<
endl;
1178 if(
track.num_channels() > 1)
1180 cerr <<
"Warning: multiple channel track being written" <<
endl;
1181 cerr <<
" as discrete will only save channel 0 !" <<
endl;
1183 for (i = 0; i <
track.num_frames(); ++i)
1192 for (i = 0; i <
track.num_frames(); ++i)
1194 if ((type & HTK_EST_PS) != 0)
1197 swapfloat(&(
track.t(i)));
1200 for (
j = 0;
j <
track.num_channels(); ++
j)
1203 swapfloat(&(
track.a(i,
j)));
1216 return htk->num_samps > 0 &&
1217 htk->samp_period > 0 &&
1218 htk->samp_size > 0 &&
1219 htk->samp_size < (
short)(UNREASONABLE_FRAME_SIZE *
sizeof(
float));
1229 if (htk_sane_header(
header))
1237 if (htk_sane_header(
header))
1246 return save_htk_as(filename,
tmp, HTK_FBANK);
1251 return save_htk_as(filename,
tmp, HTK_FBANK);
1256 return save_htk_as(filename,
tmp, HTK_MFCC);
1261 return save_htk_as(filename,
tmp, HTK_MFCC | HTK_ENERGY);
1266 return save_htk_as(filename,
tmp, HTK_USER);
1271 return save_htk_as(filename,
tmp, HTK_DISCRETE);
1286 if ((fp =
fopen(filename,
"rb")) == NULL)
1288 cerr <<
"EST_Track load: couldn't open EST_Track input file" <<
endl;
1289 return misc_read_error;
1292 fseek(fp, 0, SEEK_END);
1302 tmp.fill_time(shift);
1303 tmp.set_equal_space(TRUE);
1307 fseek(fp, 0, SEEK_SET);
1312 return misc_read_error;
1318 for (i = k = 0; i <
nframes; ++i)
1336 tmp.set_name(filename);
1337 tmp.set_file_type(tff_ema);
1360 char header[NIST_HDR_SIZE];
1370 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
1372 cerr <<
"Can't open track file " << filename <<
endl;
1373 return misc_read_error;
1377 if (
ts.fread(
header,NIST_HDR_SIZE,1) != 1)
1378 return misc_read_error;
1381 return wrong_format;
1383 samps = nist_get_param_int(
header,
"sample_count",-1);
1384 int num_channels = nist_get_param_int(
header,
"channel_count",1);
1387 nist_get_param_int(
header,
"sample_rate",def_load_sample_rate);
1389 (EST_BIG_ENDIAN ?
"10" :
"01"));
1404 return misc_read_error;
1408 fprintf(
stderr,
"TRACK read: nist header is (probably) non-standard\n");
1409 fprintf(
stderr,
"TRACK read: assuming different num_channel interpretation\n");
1415 (
const char *)
ts.filename());
1416 fprintf(
stderr,
"WAVE read: at %d got %d instead of %d samples\n",
1430 tmp.resize(num_samples, num_channels);
1431 tmp.set_equal_space(TRUE);
1432 tmp.fill_time(1/(
float)sample_rate);
1437 for (i=0; i<num_samples; i++)
1439 for (
j = 0;
j < num_channels; ++
j)
1440 tmp.a(i,
j) = data[k++];
1443 for (
j = 0;
j < num_channels; ++
j)
1444 tmp.set_channel_name(
"name",
j);
1463 if (filename ==
"-")
1465 else if ((fd =
fopen(filename,
"wb")) == NULL)
1469 char header[NIST_HDR_SIZE], p[1024];;
1474 sprintf(p,
"channel_count -i %d\n",
tr.num_channels());
1476 sprintf(p,
"sample_count -i %d\n",
tr.num_frames());
1478 int sr = (int)(rint(1/(
float)
tr.shift()));
1481 t = sample_type_to_nist(st_short);
1482 sprintf(p,
"sample_coding -s%d %s\n", (
signed)
strlen(t), t);
1491 return misc_write_error;
1494 short data[
tr.num_frames() *
tr.num_channels()];
1497 for (i = 0; i <
tr.num_frames(); ++i)
1499 for (
j = 0;
j <
tr.num_channels(); ++
j)
1500 data[k++] = (
short)(
tr.a_no_check(i,
j));
1503 int bo = str_to_bo(
"native");
1504 return save_raw_data(fd,data,0,
tr.num_frames(),
tr.num_channels(),
1541 if ((fp =
fopen(filename,
"rb")) == NULL){
1542 cerr <<
"EST_Track load: couldn't open EST_Track input file" <<
endl;
1543 return misc_read_error;
1549 return wrong_format;
1556 return read_format_error;
1559 samp_type =
header.samp_type;
1566 cerr <<
"Can't read HTK WAVEFORM format file into track" <<
endl;
1567 return misc_read_error;
1576 EST_warning(
"reading HTK_IREFC and HTK_LPREC parameter types is unsupported" );
1578 return read_format_error;
1582 pname =
"ct_cepstrum";
1588 samp_type = HTK_LPCCEP | HTK_DELTA;
1589 pname =
"ct_cepstrum";
1602 cerr <<
"Can't read HTK DISCRETE format file into track" <<
endl;
1603 return misc_read_error;
1612 return wrong_format;
1619 if(
header.samp_type & HTK_COMP ){
1626 if (num_channels > REASONABLE_FRAME_SIZE){
1637 return read_format_error;
1642 return read_format_error;
1661 return read_format_error;
1667 float shift = ((
float)
header.samp_period/ (
float)HTK_UNITS_PER_SECOND);
1672 EST_warning(
"setting htk file start to %f",
startt );
1682 return wrong_format;
1685 if (
fseek(fp,0,SEEK_END)){
1687 return wrong_format;
1693 return wrong_format;
1700 if(
header.samp_type & HTK_CRC )
1714 return wrong_format;
1719 order = num_channels;
1720 if( samp_type & HTK_NO_E )
1723 if( samp_type & HTK_AC )
1725 else if( samp_type & HTK_DELTA )
1728 if( samp_type & HTK_ENERGY )
1733 cerr <<
"Couldn't position htk file at start of data" <<
endl;
1735 return misc_read_error;
1749 cerr <<
"Could not read data from htk track file" <<
endl;
1759 return misc_read_error;
1768 for(
j=0;
j<num_channels; ++
j ){
1794 cerr <<
"Could not read data from htk track file" <<
endl;
1798 return misc_read_error;
1804 tmp.t(i) = frame[0];
1806 for(
j=0;
j<num_channels; ++
j )
1820 for (i=0;i<order;i++)
1824 tmp.set_channel_name(
t2, i);
1829 if ( (samp_type & HTK_ENERGY) && !(samp_type & HTK_NO_E) )
1830 tmp.set_channel_name(
"E", i++);
1833 if (samp_type & HTK_DELTA){
1834 for (
j = 0;
j < order;
j++){
1836 tmp.set_channel_name(t, i++);
1840 if (samp_type & HTK_ENERGY)
1841 tmp.set_channel_name(
"E_d", i++);
1845 if (samp_type & HTK_AC){
1846 for(
j=0;
j<order;
j++){
1848 tmp.set_channel_name(t, i++);
1851 if (samp_type & HTK_ENERGY)
1852 tmp.set_channel_name(
"E_d_d", i++);
1856 if (i != num_channels){
1858 <<
" channels in track but got " << i <<
endl;
1860 return wrong_format;
1862 tmp.f_set(
"contour_type",pname);
1863 tmp.set_name(filename);
1864 tmp.set_file_type(tff_htk);
1881{ channel_voiced, 1 },
1884{ channel_unknown, 0}
1897 f0_track.assign_map(ESPSF0TrackMap);
1904 for (
int i = 0; i <
track.num_frames(); ++i)
1906 f0_track.a(i, channel_voiced) =
track.track_break(i) ? 0.1 : 1.2;
1943 for (i = 0; i <
fz.num_channels(); ++i)
1945 if (
fz.channel_name(i) ==
"prob_voice")
1948 for (i = 0; i <
fz.num_channels(); ++i)
1950 if (
fz.channel_name(i) ==
"F0")
1954 for (i = 0; i <
fz.num_frames(); ++i)
1958 if (
fz.a(i, f) < 1.0)
1965 if (
fz.a(i, p) < 0.5)
1983 if (
track.has_channel(channel_lpc_N))
1984 ncoefs =
track.channel_position(channel_lpc_N) -
track.channel_position(channel_lpc_0)+1;
1990 if (
track.has_channel(channel_power))
1997 lpc.set_equal_space(
track.equal_space());
1998 lpc.set_single_break(
track.single_break());
1999 lpc.set_single_break(
track.single_break());
2001 for(
int i = 0; i<
track.num_frames(); i++)
2002 for (
int c = 0; c <
ncoefs; c++)
2004 lpc.a(i, c) =
track.a(i, channel_lpc_0, c);
2009 if (
track.has_channel(channel_power))
2033 for (p =
files.head(); p; p = p->next())
2052 if(
al.present(
"-startt") )
2055 if (
al.present(
"ishift"))
2057 else if (
al.present(
"-s"))
2059 else if (
al.present(
"time_channel"))
2062 if (
al.present(
"-itype"))
2092 for(
int n=0; n< EST_TrackFile::map.n() ; n++)
2094 const char *
nm = EST_TrackFile::map.name(EST_TrackFile::map.token(n));
2105EST_String EST_TrackFile::options_supported(
void)
2107 EST_String s(
"AvailablE track file formats:\n");
2109 for(
int n=0; n< EST_TrackFile::map.n() ; n++)
2111 const char *
nm = EST_TrackFile::map.name(EST_TrackFile::map.token(n));
2112 const char *d = EST_TrackFile::map.info(EST_TrackFile::map.token(n)).description;
2122{ tff_none, {
"none" },
2124 "unknown track file type"}},
2125{tff_esps, {
"esps" },
2126{TRUE, EST_TrackFile::load_esps, EST_TrackFile::save_esps,
2127 "entropic sps file"}},
2128{tff_est_ascii, {
"est",
"est_ascii" },
2129{TRUE, EST_TrackFile::load_est, EST_TrackFile::save_est_ascii,
2130 "Edinburgh Speech Tools track file"}},
2131{tff_est_binary, {
"est_binary" },
2132{TRUE, EST_TrackFile::load_est, EST_TrackFile::save_est_binary,
2133 "Edinburgh Speech Tools track file"}}
2136{TRUE, EST_TrackFile::load_htk, EST_TrackFile::save_htk,
2141{tff_htk_fbank, {
"htk_fbank" },
2142{FALSE, EST_TrackFile::load_htk, EST_TrackFile::save_htk_fbank,
2143 "htk file (as FBANK)"}},
2144{tff_htk_mfcc, {
"htk_mfcc" },
2145{FALSE, EST_TrackFile::load_htk, EST_TrackFile::save_htk_mfcc,
2146 "htk file (as MFCC)"}},
2147{tff_htk_mfcc_e, {
"htk_mfcc_e" },
2148{FALSE, EST_TrackFile::load_htk, EST_TrackFile::save_htk_mfcc_e,
2149 "htk file (as MFCC_E)"}},
2150{tff_htk_user, {
"htk_user" },
2151{FALSE, EST_TrackFile::load_htk, EST_TrackFile::save_htk_user,
2152 "htk file (as USER)"}},
2153{tff_htk_discrete, {
"htk_discrete" },
2154{FALSE, EST_TrackFile::load_htk, EST_TrackFile::save_htk_discrete,
2155 "htk file (as DISCRETE)"}},
2157{TRUE, EST_TrackFile::load_ssff, EST_TrackFile::save_ssff,
2158 "Macquarie University's Simple Signal File Format"}},
2160{TRUE, EST_TrackFile::load_xmg, EST_TrackFile::save_xmg,
2161 "xmg file viewer"}},
2162{tff_xgraph, {
"xgraph" },
2163{FALSE, EST_TrackFile::load_xgraph, EST_TrackFile::save_xgraph,
2164 "xgraph display program format"}},
2166{FALSE, EST_TrackFile::load_ema, NULL,
2168{tff_ema_swapped, {
"ema_swapped" },
2169{FALSE, EST_TrackFile::load_ema_swapped, NULL,
2171{tff_ascii, {
"ascii" },
2172{TRUE, EST_TrackFile::load_ascii, EST_TrackFile::save_ascii,
2173 "ascii decimal numbers"}},
2174{ tff_none, {
"none"}, {FALSE, NULL, NULL,
"unknown track file type"} }
2180EST_TrackFile::TS_Info> track_ts_names[] =
2182{ tff_none, {
"none" },
2184 "unknown track file type"}},
2186{tff_est_ascii, {
"est"},
2187{TRUE, EST_TrackFile::load_est_ts, EST_TrackFile::save_est_ts,
2188 "Edinburgh Speech Tools track file"}},
2190{tff_est_binary, {
"est_binary"},
2191{TRUE, EST_TrackFile::load_est_ts, EST_TrackFile::save_est_binary_ts,
2192 "Edinburgh Speech Tools track file"}},
2195{TRUE, EST_TrackFile::load_ssff_ts, EST_TrackFile::save_ssff_ts,
2196 "Macquarie University's Simple Signal File Format"}},
2198{ tff_none, {
"none" },
2200 "unknown track file type"}}
2204EST_TrackFile::ts_map(track_ts_names);
2207#if defined(INSTANTIATE_TEMPLATES)
2209#include "../base_class/EST_TNamedEnum.cc"
2212const char *, EST_TrackFile::Info>;
2215const char *, EST_TrackFile::TS_Info>;
static EST_String cat(const EST_String s1, const EST_String s2=Empty, const EST_String s3=Empty, const EST_String s4=Empty, const EST_String s5=Empty, const EST_String s6=Empty, const EST_String s7=Empty, const EST_String s8=Empty, const EST_String s9=Empty)
int contains(const char *s, int pos=-1) const
Does it contain this substring?
void begin(const Container &over)
Set the iterator ready to run over this container.
EST_Token get_upto(const EST_String &s)
get up to {\tt s} in stream as a single token.
int open_string(const EST_String &newbuffer)
open a \Ref{EST_TokenStream} for string rather than a file
EST_Token get_upto_eoln(void)
get up to {\tt s} in end of line as a single token.