Changeset 2573
- Timestamp:
- 05/07/08 23:22:56 (7 months ago)
- Files:
-
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm (modified) (1 diff)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm (modified) (9 diffs)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm (modified) (3 diffs)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Text.pm (modified) (3 diffs)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/interim_files/dlog (modified) (1 diff)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/output_files/MissingWords_pron (added)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/output_files/prompts (added)
- Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/test (moved) (moved from Trunk/Scripts/Audio_scripts/AudioSegmentation/test)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm
r2572 r2573 44 44 $voxforgeDict=$opt_d; 45 45 } 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"; 49 49 } else { 50 50 die "parms -a, -t, -d need to be defined\n" Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm
r2572 r2573 73 73 sub _getSampleRate { # private 74 74 my ($self) = @_; 75 my $debug = $self->{"parms"}->{"debug"}; 75 76 my $wavfilename = $self->{"filename"}; 76 77 … … 83 84 sub _forceAlign { # private 84 85 my ($self,$textContents) = @_; 86 my $debug = $self->{"parms"}->{"debug"}; 85 87 my $filename = $self->{"filename"}; 86 88 my $htk_files = $self->{'parms'}->{'htk_files'}; … … 98 100 sub _processHViteOutput { # private 99 101 my ($self) = @_; 102 my $debug = $self->{"parms"}->{"debug"}; 100 103 101 104 open(ALIGNED, "<AudioBook/interim_files/aligned.out") or confess ("can\'t open AudioBook/interim_files/aligned.out file for reading"); … … 137 140 sub segment { # public 138 141 my ($self) = @_; 139 my $debug = $self->{" debug"};142 my $debug = $self->{"parms"}->{"debug"}; 140 143 my $filename = $self->{"filename"}; 141 144 my $filename_nosuffix = $self->{"filename_nosuffix"}; 142 145 my $filename_nopath = $self->{"filename_nopath"}; 143 my $aligned_words = $self->{"aligned_words"}; 146 my $aligned_words = $self->{"aligned_words"}; 144 147 145 148 print "### segment::$filename #################################################################\n"; … … 190 193 } 191 194 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); 193 196 print "### segment summary: #################################################################\n"; 194 197 print "\nSentence Length: min:$min_sentence_length_linenumber->$min_sentence_length_found; max:$max_sentence_length_linenumber->$max_sentence_length_found\n"; … … 203 206 sub _sentence_test { # private 204 207 my ($self, $where, $increment,$aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 205 my $debug = $self->{" debug"};208 my $debug = $self->{"parms"}->{"debug"}; 206 209 my $filename_nosuffix = $self->{"filename_nosuffix"}; 207 210 … … 265 268 sub _calculateStats { # Calculate min and max sentence 266 269 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 } 275 279 my $sentence_length = (($$sentence_end + $$increment)-$$sentence_start); 276 print "sentence_length:" . $sentence_length . ":\n";280 if ($debug) {print "sentence_length:" . $sentence_length . ":\n";} 277 281 278 282 if ($sentence_length>$max_sentence_length) { … … 290 294 sub _last_sentence { # private 291 295 my ($self, $aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 292 my $debug = $self->{" debug"};296 my $debug = $self->{"parms"}->{"debug"}; 293 297 my $filename_nosuffix = $self->{"filename_nosuffix"}; 294 298 my ($count, $startTime); … … 323 327 sub _processAudio { # private 324 328 my ($self, $startTime, $endTime,$padded_fileid) = @_; 325 my $debug = $self->{" debug"};329 my $debug = $self->{"parms"}->{"debug"}; 326 330 my $process_audio = $self->{"process_audio"}; 327 331 my $samplerate = $self->{"samplerate"}; Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm
r2572 r2573 44 44 sub findOutOfVocabularyWords { # public - Find Out-Of-Vocabulary Words 45 45 my ($self,$missing_words)= @_; 46 my $debug = $self->{"parms"}->{"debug"}; 46 47 my $voxforgeDict = $self->{"voxforgeDict"}; 47 48 my $htk_files = $self->{'parms'}->{'htk_files'}; … … 78 79 sub getPronunciations { 79 80 my ($self,$missing_words_out)= @_; 81 my $debug = $self->{"parms"}->{"debug"}; 80 82 $self->{"missing_words_out"} = $missing_words_out; 81 83 my $model = $self->{'parms'}->{'g2p_model'}; … … 104 106 sub updatePronDict { 105 107 my ($self)= @_; 108 my $debug = $self->{"parms"}->{"debug"}; 106 109 my $voxforgeDict = $self->{"voxforgeDict"}; 107 110 my $missing_words_out = $self->{"missing_words_out"}; Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Text.pm
r2572 r2573 45 45 sub _clean { # private 46 46 my ($self) = @_; 47 my $debug = $self->{"parms"}->{"debug"}; 47 48 my $inputfilename = $self->{"inputfilename"}; 48 49 … … 96 97 sub createWLISTFile { # public 97 98 my ($self, $WLISTFile)= @_; 99 my $debug = $self->{"parms"}->{"debug"}; 98 100 my $words = $self->{"contents"}; 99 101 … … 113 115 sub createMLFFile { # public 114 116 my ($self,$wavfilename,$MLFFile)= @_; 117 my $debug = $self->{"parms"}->{"debug"}; 115 118 $self->{"wavfilename"} = $wavfilename; 116 119 print "wavfilename:$wavfilename\n"; Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/interim_files/dlog
r2572 r2573 1 WARNING: no script file test/VoxForgeDict.ded1 WARNING: no script file AudioBook/test/VoxForgeDict.ded 2 2 3 3 Dictionary Usage Statistics