| 89 | | #!!!!!! $command = ("cd AudioBook/interim_files && HVite -A -D -T 1 -l '*' -a -b SENT-END -m -C wav_config -H macros -H hmmdefs -m -t 250.0 150.0 1000.0 -I words.mlf -i aligned.out -S train.scp dict tiedlist"); system($command) == 0 or confess "error: $command failed: $?"; |
|---|
| 90 | | $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"); system($command) == 0 or confess "error: $command failed: $?"; |
|---|
| 91 | | |
|---|
| | 93 | $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: $?"; |
|---|
| | 94 | open (HVite_Log,"AudioBook/interim_files/logs/HVite_log") || confess "error: can't open AudioBook/interim_files/HVite_log: $?"; |
|---|
| | 95 | while (my $line = <HVite_Log>) { |
|---|
| | 96 | chomp $line; |
|---|
| | 97 | my $filename; |
|---|
| | 98 | if ($line =~ /Aligning File:/) { |
|---|
| | 99 | my @line=split(/:/, $line); |
|---|
| | 100 | $filename = pop(@line); |
|---|
| | 101 | } elsif ($line =~ /No tokens survived to final node of network at beam/) { |
|---|
| | 102 | my @line=split(/ /, $line); |
|---|
| | 103 | my $beam = pop (@line); |
|---|
| | 104 | $beam =~ s/ //g; |
|---|
| | 105 | print "\n\n******************************************************************\n"; |
|---|
| | 106 | print "**** check that audio corresponds to prompt in file ***\n"; |
|---|
| | 107 | print "******************************************************************\n\n"; |
|---|
| | 108 | if ($beam > 250) { |
|---|
| | 109 | confess "audio not corresponding to prompt file, check HVite_Log; error code: $?" ; |
|---|
| | 110 | } |
|---|
| | 111 | } |
|---|
| | 112 | } |
|---|
| 202 | | |
|---|
| 203 | | print "### segment summary: #######################################################\n"; |
|---|
| 204 | | print "\nSettings:average_sentence_length->$average_sentence_length;max_sentence_length->$max_sentence_length\n"; |
|---|
| 205 | | print " pause length:$min_pause_for_sentence_break (" . $min_pause_for_sentence_break/10000000 . " seconds)\n"; |
|---|
| 206 | | print "\nSentence Length: min:$min_sentence_length_linenumber->$min_sentence_length_found; max:$max_sentence_length_linenumber->$max_sentence_length_found\n"; |
|---|
| 207 | | print "\nSentences over max_sentence_length of $max_sentence_length words:\n"; |
|---|
| 208 | | foreach my $line (@max_sentences) { |
|---|
| 209 | | print "\t$line\n"; |
|---|
| 210 | | } |
|---|
| 211 | | print "\n###########################################################################\n"; |
|---|
| | 228 | |
|---|
| | 229 | open(LOG,">>$log") or confess ("cannot open $log file"); |
|---|
| | 230 | print LOG "\nAudio Segmenting summary:\n"; |
|---|
| | 231 | print LOG "-------------------------\n"; |
|---|
| | 232 | print LOG "Settings:average_sentence_length: $average_sentence_length\n"; |
|---|
| | 233 | print LOG " max_sentence_length: $max_sentence_length\n"; |
|---|
| | 234 | print LOG " pause length: $min_pause_for_sentence_break (" . $min_pause_for_sentence_break/10000000 . " seconds)\n\n"; |
|---|
| | 235 | print LOG "Sentence Length: min:$min_sentence_length_linenumber: $min_sentence_length_found\n"; |
|---|
| | 236 | print LOG " max:$max_sentence_length_linenumber: $max_sentence_length_found\n\n"; |
|---|
| | 237 | print LOG "Prompt lines with more than max_sentence_length of $max_sentence_length words:\n"; |
|---|
| | 238 | if (@max_sentences) { |
|---|
| | 239 | foreach my $line (@max_sentences) { |
|---|
| | 240 | print LOG "\t$line\n"; |
|---|
| | 241 | } |
|---|
| | 242 | } else { |
|---|
| | 243 | print LOG "\tnone\n"; |
|---|
| | 244 | } |
|---|