52 static int pos_phone(
const EST_Relation &seg,
float x,
float shift);
81 tmp_seg->
set(
"end", tr.
t(i - 1));
92 tmp_seg->
set(
"end", tr.
t(i - 1));
108 get_frame_o(tr, sample_rate, i, b, c, e);
110 get_frame(tr, sample_rate, i, b, c, e);
118 tmp_seg->
set(
"end", b);
123 tmp_seg->
set(
"end", c);
129 tmp_seg->
set(
"end", e);
135 float shift,
float offset,
float 142 n = (
int)ceil(lab.
tail()->
F(
"end")/shift);
143 endn = (req_l > 0.0) ? (
int)(req_l /shift) : n;
153 for (i = 0; i < n; ++i)
155 tr.
a(i) = (pos_phone(lab, tr.
t(i), shift) * range) + offset;
158 for (; i < endn; ++i)
160 tr.
a(i) = (pad ==
"high") ? range + offset : offset;
170 float shift = op.
present(
"frame_shift") ? op.
fval(
"frame_shift"): 0.01;
171 float offset = op.
present(
"label_offset")? op.
fval(
"label_offset"):0.0;
173 float range = op.
present(
"label_range") ? op.
fval(
"label_range"): 1.0;
174 float length = al.
present(
"-length") ? al.
fval(
"-length") : -1.0;
182 static int pos_phone(
const EST_Relation &seg,
float x,
float shift)
189 for (p = seg.
head(); p != 0; p = p->
next())
190 if (p->
f(
"pos") == 1)
191 if ((x < (p->
F(
"end") + (shift / 2.0))) &&
192 (x > (
start(p) - (shift / 2.0))))
Utility IO Function header file.
void label_to_track(const EST_Relation &lab, EST_Track &tr, float shift, float offset, float range, float req_l, const EST_String &pad)
void set_value(ssize_t i)
set frame i to be a value
void set(const EST_String &name, ssize_t ival)
float fval(const EST_String &rkey, int m=1) const
void resize(ssize_t num_frames, int num_channels, bool preserve=1)
const EST_Val f(const EST_String &name) const
void track_to_label(const EST_Track &tr, EST_Relation &lab, float thresh)
void set_name(const EST_String &name) const
float & t(ssize_t i=0)
return time position of frame i
float & a(ssize_t i, int c=0)
float F(const EST_String &name) const
ssize_t num_frames() const
return number of frames in track
Length of section in samples.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
Offset from frame center to center of window.
float start(const EST_Item &item)
int present(const K &rkey) const
Returns true if key is present.
EST_Item * append(EST_Item *si)
void track_to_pm(const EST_Track &tr, int sample_rate, EST_Relation &lab)
bool has_channel(const char *name) const
void fill_time(float t, int start=1)
Utility EST_String Functions header file.