Passing in a file name to cepstral perl script

Integrating the Cepstral engine

Passing in a file name to cepstral perl script

Postby blackwaterdev » Tue Dec 26, 2006 4:53 pm

I have cepstral working fine when I just pass in a string but now have the perl script below and call it from the extensions file. I know the file is there as part of my perl script
writes the file name to a temp file and I can look there then view the file which has data. It
appears that it even gets converted to a .wav file but for some reason, that file doesn't
play from the dialplan and I'm not sure why.

Please help!

Thanks.

exten => 811,9,AGI(cepstral_text.pl| ${TMPTEXTFILE})


AGI(

#!/usr/bin/perl

use Asterisk::AGI;
use File::Basename;
require Data::UUID;

$AGI = new Asterisk::AGI;

my $ug = new Data::UUID;

my $timestamp = gmtime;
my %input = $AGI->ReadParse();
my ($file_to_read)=@ARGV;
my $hash = $ug->create_str;
my $sounddir = "/var/lib/asterisk/sounds/tts";
my $wavefile = "$sounddir/"."tts-$hash.wav";
my $t2wp= "/opt/swift/bin/";

open(fileOUT, ">/tmp"."/does_it_work.txt");
print fileOUT "$file_to_read";
close(fileOUT);

my $execf=$t2wp."swift -f $sounddir/$file_to_read -p audio/channels=1,cst/f0_shift=.8,speech/rate=190,audio/sampling-rate=8000,audio/deadair=2 -o $wavefile";
system($execf);
unlink($sounddir."/$file_to_read");

$AGI->stream_file('tts/'.basename($wavefile,".wav"));
blackwaterdev
 
Posts: 1
Joined: Tue Dec 26, 2006 4:27 pm

Postby Justin » Thu Jun 07, 2007 9:17 am

A work around for this issue would be to use the AGI command EXEC(), such as:

EXEC('Swift','$contentsOfFileAsAVariable')
---------------------------------
Justin Leoni
Custom Developer
Digium
Justin
 
Posts: 6
Joined: Tue Jun 05, 2007 12:23 pm
Location: Huntsville, AL

Re: Passing in a file name to cepstral perl script

Postby wivix » Sat Jul 13, 2019 1:32 am

CEPSTRAL community is the community having the slogan of building the voices to make the voice good for everyone. The board index has the technical issues like essay pro writers with the name of passing the file issue and names.
wivix
 
Posts: 1
Joined: Sat Jul 13, 2019 1:31 am


Return to Asterisk

Who is online

Users browsing this forum: No registered users and 1 guest

cron