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/createFiles.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]; push (@{$tokens{$id}}, "$beg $end $code"); } } close LF; @wordIds = sort keys %tokens; foreach $wordId (@wordIds) { @records = @{$tokens{$wordId}}; $lettercount = 0; foreach $record (@records) { $abc = chr (97 + $lettercount); ($beg, $end, $code) = split(/\s/, $record); if ($code =~ /LINK/) {$pre = "LNK_"} elsif ($code =~ /ALT/) {$pre = "ALT_"} else {$pre = ""} $outFile = "$pre$wordId\_AM1$abc.wav"; system "$espsDir/copysd -S $beg:$end $wavFile - | bhd - - | sox -t raw -r 44100 -s -w - -t wav $outDir/$outFile"; $lettercount++; } }