voxforge.org
VoxForge Dev

Changeset 2573

Show
Ignore:
Timestamp:
05/07/08 23:22:56 (7 months ago)
Author:
kmaclean
Message:

AudioSegmentation scripts directory restructure

Files:

Legend:

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

    r2572 r2573  
    4444        $voxforgeDict=$opt_d; 
    4545} elsif ($opt_T) { 
    46         $audiofile="test/audio.wav"; 
    47         $textfile= "test/text-simple.txt"; 
    48         $voxforgeDict="test/VoxForgeDict"; 
     46        $audiofile="AudioBook/test/audio.wav"; 
     47        $textfile= "AudioBook/test/text-simple.txt"; 
     48        $voxforgeDict="AudioBook/test/VoxForgeDict"; 
    4949} else { 
    5050        die "parms -a, -t, -d need to be defined\n" 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm

    r2572 r2573  
    7373sub _getSampleRate { # private 
    7474        my ($self) = @_;         
     75        my $debug = $self->{"parms"}->{"debug"}; 
    7576        my $wavfilename = $self->{"filename"}; 
    7677         
     
    8384sub     _forceAlign { # private 
    8485        my ($self,$textContents) = @_;   
     86        my $debug = $self->{"parms"}->{"debug"}; 
    8587        my $filename = $self->{"filename"}; 
    8688        my $htk_files = $self->{'parms'}->{'htk_files'}; 
     
    98100sub _processHViteOutput { # private 
    99101        my ($self) = @_;         
     102        my $debug = $self->{"parms"}->{"debug"}; 
    100103                 
    101104        open(ALIGNED, "<AudioBook/interim_files/aligned.out") or confess ("can\'t open AudioBook/interim_files/aligned.out file for reading");  
     
    137140sub segment { # public 
    138141        my ($self) = @_;         
    139         my $debug = $self->{"debug"}; 
     142        my $debug = $self->{"parms"}->{"debug"}; 
    140143        my $filename = $self->{"filename"}; 
    141144        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    142145        my $filename_nopath = $self->{"filename_nopath"}; 
    143         my $aligned_words = $self->{"aligned_words"};  
     146        my $aligned_words = $self->{"aligned_words"}; 
    144147         
    145148        print "### segment::$filename #################################################################\n";      
     
    190193        } 
    191194         
    192         $command = ("rm AudioBook/interim_files/wav/temp.wav"); print "cmd:$command\n" if $debug; system($command); 
     195        $command = ("rm AudioBook/interim_files/temp.wav"); print "cmd:$command\n" if $debug; system($command); 
    193196        print "### segment summary: #################################################################\n";         
    194197        print "\nSentence Length: min:$min_sentence_length_linenumber->$min_sentence_length_found; max:$max_sentence_length_linenumber->$max_sentence_length_found\n"; 
     
    203206sub _sentence_test { # private 
    204207        my ($self, $where, $increment,$aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 
    205         my $debug = $self->{"debug"};   
     208        my $debug = $self->{"parms"}->{"debug"}; 
    206209        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    207210         
     
    265268sub _calculateStats { # Calculate min and max sentence 
    266269        my ($self,$sentence_start,$sentence_end,$increment,$filename_nosuffix,$padded_fileid ) = @_; 
    267         my $debug = $self->{"debug"}; 
    268          
    269         print "sentence_start:$$sentence_start\n"; 
    270         print "sentence_end:$$sentence_end\n"; 
    271         print "increment:$$increment\n"; 
    272         print "min_sentence_length_found:$min_sentence_length_found:\n"; 
    273         print "max_sentence_length:$max_sentence_length:\n"; 
    274  
     270        my $debug = $self->{"parms"}->{"debug"}; 
     271         
     272        if ($debug) { 
     273                print "sentence_start:$$sentence_start\n"; 
     274                print "sentence_end:$$sentence_end\n"; 
     275                print "increment:$$increment\n"; 
     276                print "min_sentence_length_found:$min_sentence_length_found:\n"; 
     277                print "max_sentence_length:$max_sentence_length:\n"; 
     278        } 
    275279        my $sentence_length = (($$sentence_end + $$increment)-$$sentence_start); 
    276         print "sentence_length:" . $sentence_length . ":\n"; 
     280        if ($debug) {print "sentence_length:" . $sentence_length . ":\n";} 
    277281         
    278282        if ($sentence_length>$max_sentence_length) { 
     
    290294sub _last_sentence { # private 
    291295        my ($self, $aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 
    292         my $debug = $self->{"debug"};   
     296        my $debug = $self->{"parms"}->{"debug"}; 
    293297        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    294298        my ($count, $startTime); 
     
    323327sub _processAudio { # private 
    324328        my ($self, $startTime, $endTime,$padded_fileid) = @_; 
    325         my $debug = $self->{"debug"}; 
     329        my $debug = $self->{"parms"}->{"debug"}; 
    326330        my $process_audio = $self->{"process_audio"}; 
    327331        my $samplerate = $self->{"samplerate"}; 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm

    r2572 r2573  
    4444sub findOutOfVocabularyWords { # public - Find Out-Of-Vocabulary Words 
    4545        my ($self,$missing_words)= @_;   
     46        my $debug = $self->{"parms"}->{"debug"}; 
    4647        my $voxforgeDict = $self->{"voxforgeDict"};  
    4748        my $htk_files = $self->{'parms'}->{'htk_files'}; 
     
    7879sub getPronunciations { 
    7980        my ($self,$missing_words_out)= @_;       
     81        my $debug = $self->{"parms"}->{"debug"};         
    8082        $self->{"missing_words_out"} = $missing_words_out; 
    8183        my $model = $self->{'parms'}->{'g2p_model'}; 
     
    104106sub updatePronDict { 
    105107        my ($self)= @_;          
     108        my $debug = $self->{"parms"}->{"debug"};         
    106109        my $voxforgeDict = $self->{"voxforgeDict"}; 
    107110        my $missing_words_out = $self->{"missing_words_out"};    
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Text.pm

    r2572 r2573  
    4545sub _clean { # private 
    4646        my ($self) = @_; 
     47        my $debug = $self->{"parms"}->{"debug"};         
    4748        my $inputfilename = $self->{"inputfilename"}; 
    4849 
     
    9697sub createWLISTFile { # public 
    9798        my ($self, $WLISTFile)= @_; 
     99        my $debug = $self->{"parms"}->{"debug"};         
    98100        my $words  = $self->{"contents"}; 
    99101         
     
    113115sub createMLFFile { # public 
    114116        my ($self,$wavfilename,$MLFFile)= @_; 
     117        my $debug = $self->{"parms"}->{"debug"};         
    115118        $self->{"wavfilename"} = $wavfilename;   
    116119        print "wavfilename:$wavfilename\n"; 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/interim_files/dlog

    r2572 r2573  
    1 WARNING: no script file test/VoxForgeDict.ded 
     1WARNING: no script file AudioBook/test/VoxForgeDict.ded 
    22 
    33Dictionary Usage Statistics