42 #include "sigpr/EST_sigpr_utt.h"
43 #include "EST_cmd_line_options.h"
44 #include "ling_class/EST_relation_aux.h"
47 #define SIL_NAMES "sil !ENTER !EXIT"
48 #define EVENT_NAMES "a rb arb m mrb"
71 int main(
int argc,
char *argv[])
85 EST_String(
"[input f0 file] -e [input event label file] -o [output file]"
87 "Summary: produce rfc file from events and f0 contour\n"
88 "use \"-\" to make input and output files stdin/out\n"
89 "-h Options help\n\n"+
90 options_track_input()+
"\n"
91 "-event_names <string> List of labels to be classed as events. \n"
92 " Lists are specified as quoted strings with spaces \n"
93 " separating each item, e.g.: \"a b c d\"\n\n"
94 "-sil_names <string> List of labels to be classed as silence \n"
95 " Lists are specified as quoted strings with spaces \n"
96 " separating each item, e.g.: \"pau sil #\"\n\n"
97 "-e <ifile> Input event label file. This file contains \n"
98 " the list of events to be parameterized, each with its approximate \n"
99 " start and stop time marked. This file also contains silencesn \n"
100 " which are used to decide where to insert and stop phrases \n\n"
101 "-o <ofile> Output label file\n\n"
102 "-otype <string> File type of output file \n\n"
103 "-limit <float> start and stop limit in seconds. The rfc \n"
104 " matching algorithm defines a search region within which it tries \n"
105 " all possible rise and fall shapes. This option specifies how much \n"
106 " before the input label start time and how much after the input \n"
107 " label end time the search region should be. Typical value, 0.1 \n\n"
108 "-range <float> Range of RFC search region. In addition to \n"
109 " the limit, the range defines the limits of the rfc matching \n"
110 " search region as a percentage of the overal input label \n"
111 " duration. Typical value, 0.25 (the search region is the first and \n"
112 " last 25% of the label) \n\n"
113 "-smooth Smooth and Interpolate input F0 contour. \n"
114 " rfc matching can only operate on smooth fully interpolated \n"
115 " contours. This option must be used if the contour hasn't already \n"
116 " been smoothed and interpolated\n\n"
117 "-w1 <float> length in seconds of smoothing window prior\n"
118 " to interpolation. Default value 0.05 \n\n"
119 "-w2 <float> length in seconds of smoothing window after\n"
120 " to interpolation. Default value 0.05 \n\n"
121 "-sf0 <ofile> Save f0 contour that results from smoothing \n"
122 "-rfc Save as RFC parameters instead of tilt\n\n",
126 override_rfc_params(rfc_op, al);
131 if (read_track(nfz, files.
first(), al) == -1)
136 if (ev.
load(al.
val(
"-e")) != format_ok)
139 pstring = (al.
present(
"-event_names") ? al.
val(
"-event_names"):
142 convert_to_broad(ev, event_list,
"int_event", 1);
145 pstring = (al.
present(
"-sil_names") ? al.
val(
"-sil_names"):
148 change_label(ev, sil_list,
"sil");
154 convert_to_broad(sil_lab, sil_list,
"pos", 0);
155 label_to_track(sil_lab, speech, fz.
shift());
163 ev.
f.
set(
"name",
"intevents");
164 ev.
f.
set(
"timing_style",
"segment");
187 rfc.
set(
"start_limit", al.
fval(
"-limit"));
188 rfc.
set(
"stop_limit", al.
fval(
"-limit", 0));
191 rfc.
set(
"range", al.
fval(
"-range"));
193 rfc.
set(
"min_event_duration", al.
fval(
"-min_dur"));
200 op.
set(
"window_length",0.05);
201 op.
set(
"second_length",0.05);
202 option_override(op, al,
"window_length",
"-w1");
203 option_override(op, al,
"second_length",
"-w2");
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
const T & first() const
return const reference to first item in list
float fval(const EST_String &rkey, int m=1) const
void set(const EST_String &name, int ival)
void rfc_analysis(EST_Track &fz, EST_Relation &ev, EST_Features &op)
void smooth_phrase(EST_Track &c, EST_Track &speech, EST_Features &options, EST_Track &sm)
void StringtoStrList(EST_String s, EST_StrList &l, EST_String sep)
Convert a EST_String to a EST_StrList by separating tokens in s delimited by the separator sep...
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
const int present(const K &rkey) const
Returns true if key is present.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
void rfc_to_tilt(EST_Features &rfc, EST_Features &tilt)
Convert a single set of local RFC parameters to local tilt parameters. See RFC to F0 Synthesis for a ...
EST_write_status save(const EST_String &filename, bool evaluate_ff=false) const
void remove_item_feature(const EST_String &name)
EST_read_status load(const EST_String &filename, const EST_String &type="esps")
void copy_sub_track(EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL) const
void default_rfc_params(EST_Features &op)
Utility EST_String Functions header file.