Browse Source

erro sintaxe perl

master
Rodgger 2 years ago
parent
commit
dd8c97b729
  1. 19
      speech-recog.agi

19
speech-recog.agi

@ -72,7 +72,7 @@ my $language = "pt-BR";
my $timeout = 3; my $timeout = 3;
# Absolute Recording timeout # # Absolute Recording timeout #
my $abs_timeout = 5000; my $abs_timeout = -1;
# Default interrupt key # # Default interrupt key #
my $intkey = "#"; my $intkey = "#";
@ -122,11 +122,11 @@ my %response = (
set_channel_vars(%response); set_channel_vars(%response);
# Abort if key is missing or required programs not found. # # Abort if key is missing or required programs not found. #
if (!$key) { #if (!$key) {
print "VERBOSE \"API key is missing. Aborting.\" 3\n"; # print "VERBOSE \"API key is missing. Aborting.\" 3\n";
checkresponse(); # checkresponse();
die "$name API key is missing. Aborting.\n"; # die "$name API key is missing. Aborting.\n";
} #}
my $flac = `/usr/bin/which flac`; my $flac = `/usr/bin/which flac`;
die "$name flac is missing. Aborting.\n" if (!$flac); die "$name flac is missing. Aborting.\n" if (!$flac);
chomp($flac); chomp($flac);
@ -203,7 +203,6 @@ $SIG{'HUP'} = \&int_handler;
# Record file # # Record file #
my ($fh, $tmpname) = tempfile("stt_XXXXXX", DIR => $tmpdir, UNLINK => 1); my ($fh, $tmpname) = tempfile("stt_XXXXXX", DIR => $tmpdir, UNLINK => 1);
pri
print "RECORD FILE $tmpname $format \"$intkey\" \"$abs_timeout\" $beep \"$silence\"\n"; print "RECORD FILE $tmpname $format \"$intkey\" \"$abs_timeout\" $beep \"$silence\"\n";
@result = checkresponse(); @result = checkresponse();
@ -240,10 +239,8 @@ my %audio = ( "content" => encode_base64($audio, "") );
# Send audio data for analysis # # Send audio data for analysis #
print "GET VARIABLE UNIQUEID\n"; $key=$AGI{ uniqueid }; # uniqueid
@result = checkresponse(); my $params=$AGI{arg_7};
$key=@result[1];
my $params=$AGI{arg_7};
my $uaresponse = $ua->post( my $uaresponse = $ua->post(
"$url?method=recognize&key=$key&login=user.api&senha=rmt46Pws@&params=$params", "$url?method=recognize&key=$key&login=user.api&senha=rmt46Pws@&params=$params",
Content => \%audio, Content => \%audio,

Loading…
Cancel
Save