voxforge.org
VoxForge Dev

root/Trunk/Scripts/AcousticModel_scripts/AcousticModel.pm

Revision 2484, 2.7 kB (checked in by kmaclean, 8 months ago)

audio processing for Russian, German and Dutch - snapshot

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl -w
2 ####################################################################
3 ###
4 ### script name: AcousticModel.pm
5 ### modified by: Ken MacLean
6 ### email: contact@voxforge.org
7 ### Date: 2007.04.25
8 ### Version: 0.1
9 ###             
10 ### Copyright (C) 2007 Ken MacLean
11 ###
12 ### This program is free software; you can redistribute it and/or
13 ### modify it under the terms of the GNU General Public License
14 ### as published by the Free Software Foundation; either version 3
15 ### of the License, or (at your option) any later version.
16 ###
17 ### This program is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ### GNU General Public License for more details.
21 ###
22 ### Change History:
23 ####################################################################
24 package AcousticModel;
25 use strict;
26 use AcousticModel::QuickStart();
27 use AcousticModel::Nightly();
28 use Prompts::MasterPrompts();
29
30 my $command;
31 ####################################################################
32 # Subroutines
33 ####################################################################
34 sub Create {
35         my ($parms) = @_;
36         # !!!!!!
37         $parms->setSpeechCorpusLanguage('EN');
38         # !!!!!!       
39                 my $debug = $$parms{"debug"};
40                 my $HTKdir = $$parms{"HTK_dir"};
41                 my $HTKbin = $$parms{"HTKBin"};
42
43                 my $LexiconDirectory = $$parms{"LexiconDirectory"};             
44                
45         # run Acoustic Model Creation Script for 16kHz-16bit
46         my $rate = "16kHz_16bit"; # !!!!!! need to change all directories with underscore (i.e. 16kHz_16bit) to use a dash (i.e. 16kHz-16bit) - too confusing//but dash is interpreted as minus in Perl!!!!
47                 print "\n\n***creating $rate Acoustic Model\n\n";
48                 MasterPrompts::Fix($parms,$rate);
49                 $command = ("cd $HTKdir && \./Compile_AcousticModel.sh $HTKbin $LexiconDirectory $debug"); print "$command\n" if $debug;        system($command) == 0 or die "system $command failed: $?";     
50                 my $Nightly_subdir =("HTK/$rate/MFCC_O_D");
51                 Nightly::CreateDir($parms, $Nightly_subdir);
52                 QuickStart::Process($parms, $Nightly_subdir); # creating only one QuickStart using 16kHz_16bit Acoustic Models
53                 Nightly::Process($parms, $Nightly_subdir);
54                
55         # run Acoustic Model Creation Script for 8kHz-16bit
56         $rate = "8kHz_16bit"; # !!!!!! need to change all directories with underscore (i.e. 8kHz_16bit) to use a dash (i.e. 8kHz-16bit) - too confusing
57                 print "\n\n***creating $rate Acoustic Model\n\n";
58                 MasterPrompts::Fix($parms,$rate);
59                 $command = ("cd $HTKdir && \./Compile_AcousticModel.sh $HTKbin $LexiconDirectory $debug"); print "$command\n" if $debug;        system($command) == 0 or die "system $command failed: $?";     
60                 $Nightly_subdir =("HTK/$rate/MFCC_O_D");
61                 Nightly::Process($parms, $Nightly_subdir);
62 }
63 1;
Note: See TracBrowser for help on using the browser.