Festival::Client::Async 0.0303 review
DownloadFestival::Client::Async is a non-blocking interface to a Festival server. SYNOPSIS use Festival::Client::Async qw(parse_lisp)
|
|
Festival::Client::Async is a non-blocking interface to a Festival server.
SYNOPSIS
use Festival::Client::Async qw(parse_lisp);
my $fest = Festival::Client::Async->new($host, $port);
$fest->server_eval_sync($lisp, %actions); # blocking
$fest->server_eval($lisp); # just queues $lisp for writing
if ($fest->write_pending) {
while (defined(my $b = $fest->write_more)) {
last if $b == 0;
}
}
while (defined(my $b = $fest->read_more)) {
last if $b == 0;
}
if ($fest->error_pending) {
# Oops
}
while ($fest->wave_pending) {
my $waveform_data = $fest->dequeue_wave;
# Do something with it
}
while ($fest->lisp_pending) {
my $lisp = $fest->dequeue_lisp
my $arr = parse_lisp($lisp);
# Do something with it
}
This module provides Yet Another interface to a Festival speech synthesis server.
Why should you use this module instead of the already existing ones?
Non-blocking operation. This means that this module can interoperate with a Tk, Gtk, Event, or POE event loop without the need to fork a separate process.
More flexible interface for blocking operation. You can register separate callbacks to handle the results of Scheme evaluation, waveform data, and OK/error messages.
This module is simply a very thin wrapper around Festival's Scheme read-evaluate-print loop.
If you don't know what that is, you may not want this module. If you do know what that is, this will allow you to use this module to do basically anything you could do at the actual Festival interpreter prompt. You are not limited to doing simple text-to-speech to the local audio device.
Requirements:
Perl
Festival::Client::Async 0.0303 keywords