eGuideDog::Festival is a Perl wrapper of common functions of Festival TTS.
$speaker = eGuideDog::Festival::new();
$host and $port are the Festival server host address and port number. A new server will be launched automaticly if these arguments are not specified. But you should make sure that Festival is installed on the system.
Speak text. This can be interrupted.
Speak text and wait until it finished.
Play wav file.
Synthesize a wav file from text.
Stop speaking or playing. This will not affect block_speak method.
Wait until all speech finished.
Return 1 for playing while 0 for not playing. I just check whether /dev/dsp is being used. So it doesn't work in all cases.
Return an array of voice list.
Change the current voice. the value of $voice should exist in the returned array of voice list.
Return the current value of duration stretch if $value is omited. $value between 0 to 1 makes speech slower. $value larger than 1 makes speech faster. Of course, 1 is the normal speed.
Return the current value of voice pitch if $value is omited. Otherwise, set it.
Return the current value of voice range if $value if omited. Otherwise, set it.
$| = 1; # You cannot print message in time without this.
$festival = eGuideDog::Festival::new();
$festival->block_speak('You must wait until I finished this sentence.');
$festival->speak('Thank you for your patience. You can intterupt me now.');
$festival->stop() if ($festival->is_playing());
# you can change some voice style, but I suggest saving there value first
$pitch = $festival->pitch();
$range = $festival->range();
# this is the original voice style
$festival->close(); # without this call, festival will die immediately without finishing the words.