voxforge.org
VoxForge Dev
Show
Ignore:
Timestamp:
06/04/08 11:49:09 (7 months ago)
Author:
kmaclean
Message:

AudioSegmentation scripts - snapshot

Files:

Legend:

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

    r2601 r2604  
    3131 
    3232        -a      * audio file name (WAV format only) 
    33         -b      beam width for Forced Alignment with HVit (default = 250) 
     33        -b      notify if beam width for Forced Alignment exceeds a certain level (default = 250) 
     34                (does not set HVite's beam width parameter) 
    3435        -d      pronunciation dictionary  (default = AudioBook/input_files/VoxforgeDict) 
    3536        -h      show help 
    3637        -l      LICENSE file (default = AudioBook/input_files/LICENCE) 
    37         -m      Maximum sentence length (default = 20 words) 
     38        -m      Target maximum sentence length (default = 20 words) 
    3839        -p      Minimum pause for sentence break (default = 2000000 in units of 100ns) 
    3940        -q      log words with single quotes (default = yes) 
     
    4344        -u      username or name you want file stats collected by on VoxForge Metrics  
    4445                page:   (http://www.voxforge.org/home/downloads/metrics) 
    45         -v      verify segments created from first pass Forced Alignment 
     46        -v      validate segment audio files to prompt text using forced Aligment 
     47        -w      validate missing word pronunciations to audio recordings 
    4648        -x      unique tar file suffix (max 3 characters - remainder is truncated) 
    4749        -S      run sanity test 
    4850        -T      create gzipped/tar file 
    4951 
    50                 * required for script to run 
     52                 * required for script to run 
     53 
    5154 
    5255=head1 NOTES 
     
    101104enough with this default. 
    102105 
    103 =head1 METHODS (not user accessible) 
    104  
    105 =cut 
     106=cut  
    106107 
    107108#################################################################### 
     
    114115$self{'htk_files'} = "AudioBook/input_files/htk"; 
    115116$self{'log'} = "AudioBook/output_files/AudioBook_Log"; 
     117my $self=\%self; 
     118bless($self,"AudioBook"); 
     119 
    116120my $default_average_sentence_length = 15; 
    117121my $default_max_sentence_length = 20; 
     
    122126### Main 
    123127#################################################################### 
    124 cleanupFiles(\%self); 
    125 getOptions(\%self); 
    126 process(\%self); 
     128$self->cleanupFiles(); 
     129$self->getOptions(); 
     130$self->process(); 
    127131print "completed!\n"; 
    128132 
     
    130134### Methods 
    131135#################################################################### 
     136 
     137=head1 METHODS (not user accessible) 
    132138 
    133139=head2 process 
     
    289295        my $debug = $self->{'debug'};    
    290296        getopts('a:b:d:hl:m:p:r:s:t:u:x:q:vwST');    #  sets $opt_* as a side effect. 
    291         if ($opt_a and $opt_t) {         
     297        if ($opt_S) { # Sanity test switch 
     298                $self->{"audiofile"}="AudioBook/test/audio.wav"; 
     299                #$self->{"textfile"}="AudioBook/test/text-simple.txt"; 
     300                $self->{"textfile"}="AudioBook/test/text-original.txt"; 
     301                $command = ("cp AudioBook/input_files/VoxForgeDict AudioBook/interim_files/VoxForgeDict"); print "cmd:$command\n"; system($command); 
     302                $self->{"pronDict"}="AudioBook/interim_files/VoxForgeDict"; 
     303                $self->{"tarSuffix"}=_random_characters(3); 
     304                $self->{"username"}="test"; 
     305                $self->{"average_sentence_length"}= $default_average_sentence_length; 
     306                $self->{"max_sentence_length"}= $default_max_sentence_length; 
     307                $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break; 
     308                 
     309                $self->{"log_single_quotes"}= 1; 
     310                $self->{"verify_segments"}=1;    
     311                $self->{"verify_out_of_vocabulary_pronunciations"}=1;            
     312                $self->{"README"}="AudioBook/input_files/README"; 
     313                $self->{"LICENSE"}="AudioBook/input_files/LICENSE"; 
     314        } elsif ($opt_a and $opt_t) {    
    292315                if (-r $opt_a) { 
    293316                        $self->{"audiofile"}=$opt_a; 
     
    380403                        } 
    381404                } 
    382         } elsif ($opt_S) { # Sanity test switch 
    383                 $self->{"audiofile"}="AudioBook/test/audio.wav"; 
    384                 #$self->{"textfile"}="AudioBook/test/text-simple.txt"; 
    385                 $self->{"textfile"}="AudioBook/test/text-original.txt"; 
    386                 $command = ("cp AudioBook/input_files/VoxForgeDict AudioBook/interim_files/VoxForgeDict"); print "cmd:$command\n"; system($command); 
    387                 $self->{"pronDict"}="AudioBook/interim_files/VoxForgeDict"; 
    388                 $self->{"tarSuffix"}=_random_characters(3); 
    389                 $self->{"username"}="test"; 
    390                 $self->{"average_sentence_length"}= $default_average_sentence_length; 
    391                 $self->{"max_sentence_length"}= $default_max_sentence_length; 
    392                 $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break; 
    393                  
    394                 $self->{"log_single_quotes"}= 1; 
    395                 $self->{"verify_segments"}=1;    
    396                 $self->{"README"}="AudioBook/input_files/README"; 
    397                 $self->{"LICENSE"}="AudioBook/input_files/LICENSE"; 
    398405        } elsif ($opt_h) { 
    399406                print "\nVoxForge Audio Segmentation Script Parameters\n";       
    400407                print   "=============================================\n";       
    401408                print "-a\t* audio file name (WAV format only)\n"; 
    402                 print "-b\tbeam width for Forced Alignment with HVit (default = 250)\n"; 
     409                print "-b\tnotify if beam width for Forced Alignment exceeds a certain level (default = 250)\n"; 
     410                print "\t(does not set HVite's beam width parameter)\n"; 
    403411                print "-d\tpronunciation dictionary  (default = AudioBook/input_files/VoxforgeDict)\n"; 
    404412                print "-h\tshow help\n";