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.pm

    r2590 r2591  
    3838### Class Variables 
    3939#################################################################### 
    40 our($opt_a,$opt_b,$opt_d,$opt_h,$opt_l,$opt_m,$opt_p,$opt_r,$opt_s,$opt_t,$opt_x,$opt_q,$opt_S,$opt_T,$opt_u); # need to define these because using strict. 
     40our($opt_a,$opt_b,$opt_d,$opt_h,$opt_l,$opt_m,$opt_p,$opt_r,$opt_s,$opt_t,$opt_x,$opt_q,$opt_S,$opt_T,$opt_u,$opt_v); # need to define these because using strict. 
    4141my %self; 
    4242$self{'debug'} = 0; 
     
    9494        my $audio = AudioBook::Audio->new($self); 
    9595        $audio->segment($audiofile,$textContents); 
    96         $audio->verifySegments;  
     96        if ($self->{"verify_segments"}) { 
     97                $audio->verifySegments; 
     98        }        
    9799        if (defined($tarSuffix)){ 
    98100                _createTarFile($self); 
     
    168170        my ($self)= @_; 
    169171        my $debug = $self->{'debug'};    
    170         getopts('a:b:d:hl:m:p:r:s:t:u:x:q:ST');    #  sets $opt_* as a side effect. 
     172        getopts('a:b:d:hl:m:p:r:s:t:u:x:q:v:ST');    #  sets $opt_* as a side effect. 
    171173        if ($opt_a and $opt_t) {         
    172174                if (-r $opt_a) { 
     
    206208                }        
    207209                if ($opt_q) { 
    208                         if (($opt_q eq "no") or ($opt_q eq "No") or ($opt_q eq "NO")){ 
     210                        if ($opt_v =~ /^n|no$/i){ 
    209211                                $self->{"log_single_quotes"}= 0; 
    210212                        } else { 
     
    212214                        } 
    213215                } else { 
    214                         $self->{"log_single_quotes"}= "yes";   
     216                        $self->{"log_single_quotes"}= 1;       
    215217                }        
    216218                if ($opt_b) { 
     
    219221                        $self->{"beam_width"}=250;       
    220222                } 
     223                if ($opt_v) { 
     224                        if ($opt_v =~ /^y|yes$/i) { 
     225                                $self->{"verify_segments"}=1; 
     226                        } else { 
     227                                $self->{"verify_segments"}=0; 
     228                        } 
     229                } else { 
     230                        $self->{"verify_segments"}=0;    
     231                }                
    221232                ### Tar file processing 
    222233                if (defined($opt_T)) { 
     
    261272                $self->{"max_sentence_length"}= $default_max_sentence_length; 
    262273                $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break; 
     274                 
     275                $self->{"log_single_quotes"}= 1; 
     276                $self->{"verify_segments"}=1;    
     277                $self->{"README"}="AudioBook/input_files/README"; 
     278                $self->{"LICENSE"}="AudioBook/input_files/LICENSE"; 
    263279        } elsif ($opt_h) { 
    264280                print "\nVoxForge Audio Segmentation Script Parameters\n";