File size: 918 Bytes
9f1c059
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl

# hts_engine (synthesizing waveforms using hts_engine)
$ENGINE    = '@ENGINE@';
$prjdir = '@PWD@';
$dir = "${prjdir}/wav";
$voice = "${prjdir}/voices";

   # hts_engine command line & options
   # model file & trees
	$hts_engine = "$ENGINE -m ${voice}/*.htsvoice ";
	$hts_engine .= "-b " . ( $pf_mcp - 1.0 ) . " ";

	 # generate waveform using hts_engine
		 open( SCP, "lists/gen.scp" ) || die "Cannot open $!";
		 while (<SCP>) {
		    $lab = $_;
		    chomp($lab);
		    $base = `basename $lab .lab`;
		    chomp($base);

		    print "Synthesizing a speech waveform from $lab using hts_engine...";
		    shell("$hts_engine -or ${dir}/${base}.raw -ow ${dir}/${base}.wav -ot ${dir}/${base}.trace $lab");
		    print "done.\n";
		 }
		 close(SCP);

sub shell($) {
   my ($command) = @_;
   my ($exit);

   $exit = system($command);

   if ( $exit / 256 != 0 ) {
      die "Error in $command\n";
   }
}