voxforge.org
VoxForge Dev
Show
Ignore:
Timestamp:
06/09/08 21:09:55 (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

    r2606 r2608  
    1515use Audio::Wav; 
    1616 
    17 use AudioBook::Text; 
     17#use AudioBook::Text; 
    1818 
    1919#################################################################### 
     
    6060        $fileID =~ s/\s//g; 
    6161        my $wavfilename = $fileID . "\.wav"; 
    62         my $htk_files = $super->{'htk_files'}; 
     62        my $audioBook = $super->{'audioBookObject'};     
     63        my $htk_files = $audioBook->getHtk_files(); 
    6364         
    6465        my $segmentMlf = "AudioBook/interim_files/missingWordsFolder/$fileID.mlf"; 
    65         createMLF($class,$fileID, $promptLine,$segmentMlf); 
     66        AudioBook::Text->createPromptMLF($fileID,$promptLine,$segmentMlf); 
    6667         
    6768        my $aligned_out = "AudioBook/interim_files/missingWordsFolder/$fileID.aligned.out"; 
     
    7879        #   AudioBook/interim_files/downsampled.wav 
    7980        $command = ("HVite -A -D -T 1 -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 $segmentMlf -i $aligned_out $dict $htk_files/models/tiedlist AudioBook/interim_files/missingWordsFolder/$wavfilename > $log"); system($command) == 0 or confess "error: $command failed: $?"; 
    80            
    8181        return ($aligned_out, $log); 
    82 } 
    83  
    84 =head2 createMLFFile  
    85  
    86 creates an MLF (HTK required "Multi-Label File") file for a prompt. 
    87   
    88 =cut 
    89  
    90 sub createMLF { # public 
    91         my ($class,$fileID,$promptLine,$segmentMlf)= @_; 
    92         open(MLF, ">$segmentMlf") or confess ("cannot open $segmentMlf for output");     
    93         print MLF "#!MLF!#\n"; #  
    94         print MLF "\"AudioBook/interim_files/missingWordsFolder/$fileID.lab\"\n"; 
    95         foreach my $word (@$promptLine) { 
    96                 print MLF "$word\n"; 
    97         } 
    98         print MLF "\.\n"; 
    9982} 
    10083 
     
    182165        # !!!!!! 
    183166#       $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: $?"; 
    184         $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: $?"; 
     167        $command = ("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: $?"; 
    185168# !!!!!! 
    186169        open (HVite_Log,"AudioBook/interim_files/logs/HVite_log") || confess "error: can't open AudioBook/interim_files/HVite_log: $?";