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/try.perl~
#!/usr/bin/perl while (<>) { @binLine = split; push (@levels, @binLine[1..8]); } #$infile = "wav/Am_$ARGV[0].wav"; #open (INF, $infile) or die "can't open $infile"; $samples = 44100; $window = int ($samples * 0.1); $count = 0; $start = 0 * $samples; $end = 60 * $samples; @levels = (); while (<>) { @binLine = split; if ($count > ($end + 6)) { return;} if ($count > ($end + 6)) { die "uh oh"; } if ($count >= $start) { push (@levels, @binLine[1..8]); } $count += 7; } for ($n = 0;$n <= $count; $n + $window) { $sum = 0; @energy = @levels[$n .. $n + $window]; foreach $value (@energy) { $value += $num; } $avg = $value / ($n + $window); $div+= 1; }