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/fixtime.perl~
#!/usr/bin/perl #use Getopt::Std; #getopts('a:d:'); $list_adjust = 0; #$opt_a; # not used right now $timelag = 0; # $opt_d; # not used right now $baseFileName = $ARGV[0]; $file = "/pkg/ldc/talkbank/nahuatl/DAT/am/log/Am$baseFileName.log"; $wav_file = "/pkg/ldc/talkbank/nahuatl/DAT/am/wav/Am$baseFileName.wav"; open (BEEPLOG, "/pkg/ldc/talkbank/nahuatl/DAT/am/log/logFileAdjustments.text"); while (<BEEPLOG>) { chomp; if (/$baseFileName/) {$list_adjust = ((split)[2]);} } $esps_bin = "/pkg/esps/bin"; # esps directory name $out = `$esps_bin/epsps -D $wav_file`; $out =~ /Number of data records: (\d+)/; $totalsamples = $1; $totalseconds = $1 / 44100; $endtime = $totalseconds * 1000; open (LOGFILE, "$file"); $n = 0; while (<LOGFILE>) { @t = split(/\t/); if (/ORIG/) { $wordid[$n] = $t[1]; $wordname[$n] = $t[2]; #if ($n - $list_adjust >= 0) { $time[$n] = $t[3]; $type[$n] = "ORIG"; } if (/REDO/) { $wordid[$n] = $wordid[$n-1]; $wordname[$n] = $wordname[$n-1]; $time[$n] = $t[1]; $type[$n] = "REDO"; } $n++; } $time[$n] = ($totalsamples / 44100) * 1000 + $time[0]; # realign times according to -t option for($count=0; $count < $n - $list_adjust; $count++) { $timeStart = (($time[$count+$list_adjust] - $time[0])/1000) + $timelag; $timeEnd = (($time[$count+$list_adjust+1] - $time[0])/1000) + $timelag; printf( "%9.3f%9.3f\t$wordid[$count]\t%-28s\t$type[$count]\n", $timeStart,$timeEnd,$wordname[$count],); }