From ccc14db989b69debc1e7dac28a157447ed050f65 Mon Sep 17 00:00:00 2001 From: Kevin Lenzo Date: Wed, 8 Apr 2026 10:38:06 -0400 Subject: [PATCH] Fix make_feats.pl: define ctlcount and ctloffset from control file Count lines in the list file and partition like s3decode.pl so Log() and RunTool(sphinx_fe, ...) receive correct segment bounds for -part/-npart. --- scripts/000.comp_feat/make_feats.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/000.comp_feat/make_feats.pl b/scripts/000.comp_feat/make_feats.pl index e1edc8c9..20635b48 100644 --- a/scripts/000.comp_feat/make_feats.pl +++ b/scripts/000.comp_feat/make_feats.pl @@ -90,13 +90,19 @@ } open CTL, "<$ctlfile" or die "Failed to open control file $ctlfile: $!"; +my @ctl_lines; while () { chomp; + push @ctl_lines, $_; my $dir = dirname($_); mkpath(catdir($ST::CFG_FEATFILES_DIR, $dir)); } close CTL; +my $nlines = scalar @ctl_lines; +my $ctloffset = int( ( $nlines * ( $part - 1 ) ) / $npart ); +my $ctlcount = int( ( $nlines * $part ) / $npart ) - $ctloffset; + if (defined($warp)) { Log("Extracting features from $ctlcount segments starting at $ctloffset with warp factor $warp (part $part of $npart)\n", 'audio files'); } else {