Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
poser
/
Foley programs and data
/
spd24_nahuatl_dat_am
/
Upload File :
New :
File
Dir
//home/cluster1/data/bu01/1121861/html/poser/Foley programs and data/spd24_nahuatl_dat_am/copyMP.perl
#!/usr/bin/perl $prefix = $ARGV[0]; $logFile = "$prefix.list"; $espsDir = "/pkg/esps/bin"; $wavFile = "/pkg/ldc/talkbank/nahuatl/DAT/am/wav/Am_$prefix.wav"; $outDir = "/pkg/ldc/talkbank/nahuatl/DAT/am/final/$prefix"; if (!-d $outDir) {system "mkdir $outDir"} open (LF, $logFile); while (<LF>) { if ((/KEEP/) || (/keep/) || (/LINK/) || (/ALT/)) { chomp; @t = split(/\t/); @s = split(/\s+/); $beg = $s[1]; $end = $s[2]; $id = $s[3]; $code = $t[5]; $wordName = $t[2]; push (@{$tokens{$id}}, "$beg\t$end\t$code\t$wordName"); } } close LF; @wordIds = sort keys %tokens; foreach $wordId (@wordIds) { @records = @{$tokens{$wordId}}; $lettercount = 0; foreach $record (@records) { $abc = chr (97 + $lettercount); ($beg, $end, $code, $tmpWord) = split(/\t/, $record); if ($code =~ /LINK/) {$pre = "LNK_"} elsif ($code =~ /ALT/) {$pre = ""} else {$pre = ""} (my $outWord, $nul) = split(/\s+/, $tmpWord, 2); $outFile = "$pre$outWord\_AM1$abc.wav"; #print "$outFile\n"; system "$espsDir/copysd -S $beg:$end $wavFile - | bhd - - | sox -t raw -r 44100 -s -w - -t wav $outDir/$outFile"; $lettercount++; } }