#!/usr/bin/perl # # faceClient # CGI speech cue interface to local voiceServer # Requires # URI::Escape # IPC::Shareable # CGI::Request use IPC::Shareable; use CGI::Request; # Debugging stuff $IPC::Shareable::Debug = 1; # Simple interface: (combines SendHeaders, new and import_names) my $req = GetRequest($pkg); # Full Interface: # We only need to output info, so this isn't required. $req = new CGI::Request; # fetch and parse request my $cueglue = 'cuedata'; my %options = ( 'key' => 'cue', 'create' => 0, 'exclusive' => 0, 'mode' => 0644, 'destroy' => 0, ); $knot = tie(%cueinfo, IPC::Shareable, $cueglue, { %options }) or die "$$: tie failed $!\n"; if ($req->param('speechtext') eq "") { if($req->param('speechmacro') eq "") { if ($req->param('emotion') ne "") { # Send emotion only } } else { # Send macro setcue($req->param('speechmacro')); } } else { # Send speechtext setcue($req->param('speechtext')); } print ""; print "
"; print ""; print "
"; print ""; #print ""; print ""; print "
Macros:
"; print ""; print "
"; print ""; print "
"; exit; sub setcue { ($cuestring) = @_; $knot->shlock; $cueinfo{cuestring} = $cuestring; $cueinfo{timestamp} = time(); $knot->shunlock; print "Saying: $cuestring\n"; }