voxforge.org
VoxForge Dev
Show
Ignore:
Timestamp:
05/26/08 09:24:36 (6 months ago)
Author:
kmaclean
Message:

AudioSegmentation scripts -snapshot

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm

    r2590 r2591  
    105105        #   AudioBook/interim_files/dict AudioBook/input_files/htk/models/tiedlist   
    106106        #   AudioBook/interim_files/downsampled.wav 
    107         $command = ("pwd && HVite -A -D -T 1 -l '*' -a -b SENT-END -m -C $htk_files/wav_config -H $htk_files/models/macros -H $htk_files/models/hmmdefs -m -t 250.0 150.0 1000.0 -I AudioBook/interim_files/words.mlf  -i AudioBook/interim_files/aligned.out -S $htk_files/train.scp AudioBook/interim_files/dict $htk_files/models/tiedlist > AudioBook/interim_files/logs/HVite_log"); system($command) == 0 or confess "error: $command failed: $?"; 
     107        # !!!!!! 
     108#       $command = ("pwd && HVite -A -D -T 1 -l '*' -a -b SENT-END -m -C $htk_files/wav_config -H $htk_files/models/macros -H $htk_files/models/hmmdefs -m -t 250.0 150.0 1000.0 -I AudioBook/interim_files/words.mlf  -i AudioBook/interim_files/aligned.out -S $htk_files/train.scp AudioBook/interim_files/dict $htk_files/models/tiedlist > AudioBook/interim_files/logs/HVite_log"); system($command) == 0 or confess "error: $command failed: $?"; 
     109        $command = ("pwd && HVite -A -D -T 1 -l '*' -a -b SENT-END -m -C $htk_files/wav_config -H $htk_files/models/macros -H $htk_files/models/hmmdefs -m -t 500.0 150.0 8000.0 -I AudioBook/interim_files/words.mlf  -i AudioBook/interim_files/aligned.out -S $htk_files/train.scp AudioBook/interim_files/dict $htk_files/models/tiedlist > AudioBook/interim_files/logs/HVite_log"); system($command) == 0 or confess "error: $command failed: $?"; 
     110# !!!!!! 
    108111        open (HVite_Log,"AudioBook/interim_files/logs/HVite_log") || confess "error: can't open AudioBook/interim_files/HVite_log: $?"; 
    109112        while (my $line = <HVite_Log>) { 
     
    257260                print LOG "\tnone\n"; 
    258261        } 
     262        close LOG; 
    259263} 
    260264 
     
    412416sub verifySegments { #public 
    413417        my ($self) = @_;                 
    414         my $debug = $self->{"debug"};            
     418        my $debug = $self->{"debug"};    
     419        my $log = $self->{"log"}; 
     420                 
    415421        open(PROMPTS, "<AudioBook/interim_files/prompts") or confess ("cannot open AudioBook/output_files/prompts for output"); 
    416422        my @promptScores;        
     
    418424                chomp $line; 
    419425                my @promptList = split(" ", $line); 
    420                 my $wavfilename = shift(@promptList) . "\.wav"; 
     426                my $fileID = shift(@promptList); 
     427                my $wavfilename = $fileID . "\.wav"; 
    421428                $self->_createMLFFile(\@promptList); 
    422429                #print "Force Align:$wavfilename:@promptList\n";         
    423430                $self->_forceAlignSegment($wavfilename); 
    424431                my $avgLogLikelihoodPerFrame = $self->_processHviteLog($wavfilename); 
    425                 push (@promptScores,[$avgLogLikelihoodPerFrame,$wavfilename, "@promptList"]); 
     432                push (@promptScores,[$avgLogLikelihoodPerFrame,$fileID,"@promptList"]); 
    426433        } 
    427434        close (PROMPTS);                 
    428435        close (MLF);             
    429436        #my @sortedlist = sort @promptScores; 
    430         my @sortedlist = sort { $a->[0] cmp $b->[0] } (@promptScores); # reverse sort of 1st element of @promptScores (which is an array of arrays) 
    431  
     437        my @sortedlist = sort { $a->[0] cmp $b->[0] } (@promptScores); # sort of 1st element of @promptScores (which is an array of arrays) 
     438         
     439        open(LOG,">>$log") or confess ("cannot open $log file");         
     440        print LOG "\nprompts with the lowest average log likelihood per frame:\n"; 
     441        print LOG "\n(confirm anything with an avgloglik of less than 60):\n";   
     442        print LOG   "---------------------------------------------------------\n"; 
     443        my $x;   
    432444        foreach my $line (@sortedlist) { 
    433                 print "Force Align:$$line[0] $$line[1] $$line[2]\n"; 
    434         } 
    435         print "completed\n"; 
     445                print LOG "$$line[0] $$line[1] $$line[2]\n"; 
     446                $x++; 
     447                last if ($x > 15); 
     448        } 
     449        close LOG; 
    436450} 
    437451