Author image 黄冠能

NAME

eGuideDog::Festival - Wrapper of common functions of Festival TTS.

VERSION

Version 0.1

SYNOPSIS

  use eGuideDog::Festival;

  $speaker = eGuideDog::Festival::new();
  $speaker->block_speak("hello world");

DESCRIPTION

This package provides simple way to use Festival speech synthesis system without knowing Scheme language.

METHODS

new($host, $port)

$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)

Speak text. This can be interrupted.

block_speak($text)

Speak text and wait until it finished.

play($filename)

Play wav file.

output($text, $filename)

Synthesize a wav file from text.

stop()

Stop speaking or playing. This will not affect block_speak method.

close()

Wait until all speech finished.

is_playing()

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.

voice_list()

Return an array of voice list.

set_voice($voice)

Change the current voice. the value of $voice should exist in the returned array of voice list.

duration_stretch($value)

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.

pitch($value)

Return the current value of voice pitch if $value is omited. Otherwise, set it.

range($value)

Return the current value of voice range if $value if omited. Otherwise, set it.

EXAMPLE

  use eGuideDog::Festival;

  $| = 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.');
  sleep(1);
  $festival->stop() if ($festival->is_playing());

  # you can change some voice style, but I suggest saving there value first
  $festival->duration_stretch(1.5);
  $pitch = $festival->pitch();
  $festival->pitch(200);
  $range = $festival->range();
  $festival->range(200);
  $festival->speak('hello world');

  # this is the original voice style
  $festival->duration_stretch(1);
  $festival->pitch($pitch);
  $festival->range($range);
  $festival->speak('hello world');

  $festival->close(); # without this call, festival will die immediately without finishing the words.

SEE ALSO

Speech::Festival, Festival::Client::Async, Festival::Client, Speech::Festival::Synthesiser

AUTHOR

Cameron Wong, <hgn823-eguidedog002 at yahoo.com.cn>, http://e-guidedog.sourceforge.net

BUGS

This module may only work on Linux/Unix operating system.

In some documents, the symbol "'" is interpreted as Chinese symbol not the single quote. So copy and paste code may not always work. It seems a bug of some auto-generating tools. I am still wondering why.

Please report any bugs or feature requests to bug-eguidedog-festival at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=eGuideDog-Festival. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc eGuideDog::Festival

You can also look for information at:

ACKNOWLEDGEMENTS

This program is developped basing on Richard Caley's Speech::Festival.

COPYRIGHT & LICENSE

Copyright 2007 Cameron Wong, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.