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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

to this function should be added to the initialization function in the directory you are adding the module too. The<br />

function is called festival_DIRNAME_init(). If one doesn't exist you'll need to create it.<br />

In `./src/Duration/' the function festival_Duration_init() is at the end of the file<br />

`dur_aux.cc'. Thus we can add our new modules declaration at the end of that function. But first we must<br />

declare the C++ function in that file. Thus above that function we would add<br />

LISP FT_Duration_Simple(LISP args);<br />

While at the end of the function festival_Duration_init() we would add<br />

festival_def_utt_module("Duration_Simple",FT_Duration_Simple,<br />

"(Duration_Simple UTT)\n\<br />

Label all segments with average duration ... ");<br />

In order for our new file to be compiled we must add it to the `Makefile' in that directory, to the SRCS variable.<br />

Then when we type make in `./src/' our new module will be properly linked in and available for use.<br />

Of course we are not quite finished. We still have to say when our new duration module should be called. When we<br />

set<br />

(Parameter.set 'Duration_Method Duration_Simple)<br />

for a voice it will use our new module, calls to the function utt.synth will use our new duration module.<br />

Note in earlier versions of <strong>Festival</strong> it was necessary to modify the duration calling function in<br />

`lib/duration.scm' but that is no longer necessary.<br />

[ < ] [ > ] [ > ] [Top] [Contents] [Index] [ ? ]<br />

27.2.2 Example 2: accessing the utterance<br />

In this example we will make more direct use of the utterance structure, showing the gory details of following<br />

relations in an utterance. This time we will create a module that will name all syllables with a concatenation of the<br />

names of the segments they are related to.<br />

As before we need the same standard includes<br />

#include "festival.h"<br />

Now the definition the function<br />

LISP FT_Name_Syls(LISP utt)<br />

{<br />

As with the previous example we are called with an utterance LISP object and will return the same. The first task is<br />

to extract the utterance object from the LISP object.<br />

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

EST_Item *syl,*seg;<br />

Now for each syllable in the utterance we want to find which segments are related to it.<br />

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

{<br />

Here we declare a variable to cummulate the names of the segments.

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

Saved successfully!

Ooh no, something went wrong!