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.

into name and IP address. Note that we recursively call the function email_previous_t2w_func on the email<br />

name and IP address so that they will be pronounced properly. Note that because that function returns a list of words<br />

we need to append them together.<br />

((string-matches name "")<br />

(append<br />

(email_previous_t2w_func token<br />

(string-after (string-before name "@") "")))))<br />

Our next condition deals with identifying a greater than sign being used as a quote marker. When we detect this we<br />

select the alternative speaker, even though it may already be selected. We then return no words so the quote marker is<br />

not spoken. The following condition finds greater than signs which are the first token on a line.<br />

((and (string-matches name ">")<br />

(string-matches (item.feat token "whitespace")<br />

"[ \t\n]*\n *"))<br />

(voice_don_diphone)<br />

nil ;; return nothing to say<br />

)<br />

If it doesn't match any of these we can go ahead and use the builtin token to words function Actually, we call the<br />

function that was set before we entered this mode to ensure any other specific rules still remain. But before that we<br />

need to check if we've had a newline with doesn't start with a greater than sign. In that case we switch back to the<br />

primary speaker.<br />

(t ;; for all other cases<br />

(if (string-matches (item.feat token "whitespace")<br />

".*\n[ \t\n]*")<br />

(voice_rab_diphone))<br />

(email_previous_t2w_func token name))))<br />

In addition to these we have to actually declare the text mode. This we do by adding to any existing modes as<br />

follows.<br />

(set! tts_text_modes<br />

(cons<br />

(list<br />

'email ;; mode name<br />

(list ;; email mode params<br />

(list 'init_func email_init_func)<br />

(list 'exit_func email_exit_func)<br />

'(filter "email_filter")))<br />

tts_text_modes))<br />

This will now allow simple email messages to be dealt with in a mode specific way.<br />

An example mail message is included in `examples/ex1.email'. To hear the result of the above text mode<br />

start <strong>Festival</strong>, load in the email mode descriptions, and call TTS on the example file.<br />

(tts ".../examples/ex1.email" 'email)<br />

The above is very short of a real email mode but does illustrate how one might go about building one. It should be<br />

reiterated that text modes are new in <strong>Festival</strong> and their most effective form has not been discovered yet. This will<br />

improve with time and experience.<br />

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

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

Saved successfully!

Ooh no, something went wrong!