12.12.2012 Views

Festival Speech Synthesis System: - Speech Resource Pages

Festival Speech Synthesis System: - Speech Resource Pages

Festival Speech Synthesis System: - Speech Resource Pages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EST_Utterance *u = get_c_utt(utt);<br />

EST_Item *s;<br />

float end=0.0, dur;<br />

LISP ph_avgs,ldur;<br />

We cannot list the average durations for each phone in the source code as we cannot tell which phoneset we are using<br />

(or what modifications we want to make to durations between speakers). Therefore the phone and average duration<br />

information is held in a Scheme variable for easy setting at run time. To use the information in our C++ domain we<br />

must get that value from the Scheme domain. This is done with the following statement.<br />

ph_avgs = siod_get_lval("phoneme_averages","no phoneme durations");<br />

The first argument to siod_get_lval is the Scheme name of a variable which has been set to an assoc list of<br />

phone and average duration before this module is called. See the variable phone_durations in<br />

`lib/mrpa_durs.scm' for the format. The second argument to siod_get_lval. is an error message to be<br />

printed if the variable phone_averages is not set. If the second argument to siod_get_lval is NULL then no<br />

error is given and if the variable is unset this function simply returns the Scheme value nil.<br />

Now that we have the duration data we can go through each segment in the utterance and add the duration. The loop<br />

looks like<br />

for (s=u->relation("Segment")->head(); s != 0; s = next(s))<br />

{<br />

We can lookup the average duration of the current segment name using the function siod_assoc_str. As<br />

arguments, it takes the segment name s->name() and the assoc list of phones and duration.<br />

ldur = siod_assoc_str(s->name(),ph_avgs);<br />

Note the return value is actually a LISP pair (phone name and duration), or nil if the phone isn't in the list. Here we<br />

check if the segment is in the list. If it is not we print an error and set the duration to 100 ms, if it is in the list the<br />

floating point number is extracted from the LISP pair.<br />

if (ldur == NIL)<br />

{<br />

cerr

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!