- Timestamp:
- 06/04/08 11:49:09 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm
r2601 r2604 31 31 32 32 -a * audio file name (WAV format only) 33 -b beam width for Forced Alignment with HVit (default = 250) 33 -b notify if beam width for Forced Alignment exceeds a certain level (default = 250) 34 (does not set HVite's beam width parameter) 34 35 -d pronunciation dictionary (default = AudioBook/input_files/VoxforgeDict) 35 36 -h show help 36 37 -l LICENSE file (default = AudioBook/input_files/LICENCE) 37 -m Maximum sentence length (default = 20 words)38 -m Target maximum sentence length (default = 20 words) 38 39 -p Minimum pause for sentence break (default = 2000000 in units of 100ns) 39 40 -q log words with single quotes (default = yes) … … 43 44 -u username or name you want file stats collected by on VoxForge Metrics 44 45 page: (http://www.voxforge.org/home/downloads/metrics) 45 -v verify segments created from first pass Forced Alignment 46 -v validate segment audio files to prompt text using forced Aligment 47 -w validate missing word pronunciations to audio recordings 46 48 -x unique tar file suffix (max 3 characters - remainder is truncated) 47 49 -S run sanity test 48 50 -T create gzipped/tar file 49 51 50 * required for script to run 52 * required for script to run 53 51 54 52 55 =head1 NOTES … … 101 104 enough with this default. 102 105 103 =head1 METHODS (not user accessible) 104 105 =cut 106 =cut 106 107 107 108 #################################################################### … … 114 115 $self{'htk_files'} = "AudioBook/input_files/htk"; 115 116 $self{'log'} = "AudioBook/output_files/AudioBook_Log"; 117 my $self=\%self; 118 bless($self,"AudioBook"); 119 116 120 my $default_average_sentence_length = 15; 117 121 my $default_max_sentence_length = 20; … … 122 126 ### Main 123 127 #################################################################### 124 cleanupFiles(\%self);125 getOptions(\%self);126 process(\%self);128 $self->cleanupFiles(); 129 $self->getOptions(); 130 $self->process(); 127 131 print "completed!\n"; 128 132 … … 130 134 ### Methods 131 135 #################################################################### 136 137 =head1 METHODS (not user accessible) 132 138 133 139 =head2 process … … 289 295 my $debug = $self->{'debug'}; 290 296 getopts('a:b:d:hl:m:p:r:s:t:u:x:q:vwST'); # sets $opt_* as a side effect. 291 if ($opt_a and $opt_t) { 297 if ($opt_S) { # Sanity test switch 298 $self->{"audiofile"}="AudioBook/test/audio.wav"; 299 #$self->{"textfile"}="AudioBook/test/text-simple.txt"; 300 $self->{"textfile"}="AudioBook/test/text-original.txt"; 301 $command = ("cp AudioBook/input_files/VoxForgeDict AudioBook/interim_files/VoxForgeDict"); print "cmd:$command\n"; system($command); 302 $self->{"pronDict"}="AudioBook/interim_files/VoxForgeDict"; 303 $self->{"tarSuffix"}=_random_characters(3); 304 $self->{"username"}="test"; 305 $self->{"average_sentence_length"}= $default_average_sentence_length; 306 $self->{"max_sentence_length"}= $default_max_sentence_length; 307 $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break; 308 309 $self->{"log_single_quotes"}= 1; 310 $self->{"verify_segments"}=1; 311 $self->{"verify_out_of_vocabulary_pronunciations"}=1; 312 $self->{"README"}="AudioBook/input_files/README"; 313 $self->{"LICENSE"}="AudioBook/input_files/LICENSE"; 314 } elsif ($opt_a and $opt_t) { 292 315 if (-r $opt_a) { 293 316 $self->{"audiofile"}=$opt_a; … … 380 403 } 381 404 } 382 } elsif ($opt_S) { # Sanity test switch383 $self->{"audiofile"}="AudioBook/test/audio.wav";384 #$self->{"textfile"}="AudioBook/test/text-simple.txt";385 $self->{"textfile"}="AudioBook/test/text-original.txt";386 $command = ("cp AudioBook/input_files/VoxForgeDict AudioBook/interim_files/VoxForgeDict"); print "cmd:$command\n"; system($command);387 $self->{"pronDict"}="AudioBook/interim_files/VoxForgeDict";388 $self->{"tarSuffix"}=_random_characters(3);389 $self->{"username"}="test";390 $self->{"average_sentence_length"}= $default_average_sentence_length;391 $self->{"max_sentence_length"}= $default_max_sentence_length;392 $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break;393 394 $self->{"log_single_quotes"}= 1;395 $self->{"verify_segments"}=1;396 $self->{"README"}="AudioBook/input_files/README";397 $self->{"LICENSE"}="AudioBook/input_files/LICENSE";398 405 } elsif ($opt_h) { 399 406 print "\nVoxForge Audio Segmentation Script Parameters\n"; 400 407 print "=============================================\n"; 401 408 print "-a\t* audio file name (WAV format only)\n"; 402 print "-b\tbeam width for Forced Alignment with HVit (default = 250)\n"; 409 print "-b\tnotify if beam width for Forced Alignment exceeds a certain level (default = 250)\n"; 410 print "\t(does not set HVite's beam width parameter)\n"; 403 411 print "-d\tpronunciation dictionary (default = AudioBook/input_files/VoxforgeDict)\n"; 404 412 print "-h\tshow help\n";