[hts-users:02730] Bug in HTS 2.2 beta derived from SPTK 3.4's bcut
- Subject: [hts-users:02730] Bug in HTS 2.2 beta derived from SPTK 3.4's bcut
- From: "Nicholas Volk" <nvolk@xxxxxxxxxx>
- Date: Sun, 13 Mar 2011 23:48:26 +0200
- Delivered-to: hts-users@xxxxxxxxxxxxxxx
- Importance: Normal
Thanks for the new version,
Atypically I ran the new version on Cygwin/Windows (instead of the
standard Linux) and encountered a problem when making global variance:
Making data, labels, and scp from bl_fi_mv_clunits_95.lab for GV...Error
in /usr/local/SPTK/bin/bcut -s 710 -e 720 -l 1 +f
/home/niko/HTS-demo_BL_FI_MV2/data/lf0/bl_fi_mv_clunits_95.lf0 >>
/home/niko/HTS-demo_BL_FI_MV2/gv/qst001/ver1/dat/tmp.lf0
Windows/Cygwin seems to be more sensitive about unclosed filess than Linux.
The problem seem to be that
fp = getfp(*argv, "rb");
gets never closed in SPTK's bcut.c. I think there should be a line
if ( fp != stdin ) { close(fp) }
before the return command in bcutc.'s main().
While at it, as GV stuff is very slow, I also tried to make it a bit
faster, by reducing the number of calls to bcut in Training.pl. I modified
the stuff inside the following condition:
if ( $nosilgv && @slnt > 0 ) {
My faster version looks like:
if ( $nosilgv && @slnt > 0 ) {
shell("rm -f $gvdatdir/tmp.$type");
shell("touch $gvdatdir/tmp.$type");
open( F, "$gvfaldir/$base.lab" ) || die "Cannot open $!";
my $cache = ( 1.0e-7 / ( $fs / $sr ) );
$start = 0;
$end = 0;
while ( $str = <F> ) {
chomp($str);
@arr = split( / /, $str ); # start end phone
$find = 0;
for ( $j = 0 ; $j < @slnt ; $j++ ) {
if ( $arr[2] eq "$slnt[$j]" ) {
if ( $start < $end ) {
shell("$BCUT -s $start -e $end -l $ordr{$type} +f
$datdir/$type/$base.$type >> $gvdatdir/tmp.$type");
$start = $end = int( $arr[0] * $cache );
}
$find = 1; last;
}
}
if ( $find == 0 ) {
$end = int( $arr[1] * $cache );
}
}
if ( $start < $end ) {
shell("$BCUT -s $start -e $end -l $ordr{$type} +f
$datdir/$type/$base.$type >> $gvdatdir/tmp.$type");
}
close(F);
}
This I haven't tested properly yet, but I think the idea is valid
regardless. Just about the restart the build...
(And sorry for not probiding a diff.)
br,
Nicholas