- Timestamp:
- 06/09/08 21:09:55 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm
r2606 r2608 15 15 use Audio::Wav; 16 16 17 use AudioBook::Text;17 #use AudioBook::Text; 18 18 19 19 #################################################################### … … 60 60 $fileID =~ s/\s//g; 61 61 my $wavfilename = $fileID . "\.wav"; 62 my $htk_files = $super->{'htk_files'}; 62 my $audioBook = $super->{'audioBookObject'}; 63 my $htk_files = $audioBook->getHtk_files(); 63 64 64 65 my $segmentMlf = "AudioBook/interim_files/missingWordsFolder/$fileID.mlf"; 65 createMLF($class,$fileID,$promptLine,$segmentMlf);66 AudioBook::Text->createPromptMLF($fileID,$promptLine,$segmentMlf); 66 67 67 68 my $aligned_out = "AudioBook/interim_files/missingWordsFolder/$fileID.aligned.out"; … … 78 79 # AudioBook/interim_files/downsampled.wav 79 80 $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 81 81 return ($aligned_out, $log); 82 }83 84 =head2 createMLFFile85 86 creates an MLF (HTK required "Multi-Label File") file for a prompt.87 88 =cut89 90 sub createMLF { # public91 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";99 82 } 100 83 … … 182 165 # !!!!!! 183 166 # $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: $?"; 185 168 # !!!!!! 186 169 open (HVite_Log,"AudioBook/interim_files/logs/HVite_log") || confess "error: can't open AudioBook/interim_files/HVite_log: $?";