Skip to content

Commit b5f4cfc

Browse files
entn-atdanpovey
authored andcommitted
[src] Fix bug in resampling checks for online features (#3639)
The --allow-upsample and --allow-downsample options were not handled correctly in the code that handles resampling for computing online features.
1 parent 526ade1 commit b5f4cfc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/feat/online-feature.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ void OnlineGenericBaseFeature<C>::MaybeCreateResampler(
8888
if (resampler_ != nullptr) {
8989
KALDI_ASSERT(resampler_->GetInputSamplingRate() == sampling_rate);
9090
KALDI_ASSERT(resampler_->GetOutputSamplingRate() == expected_sampling_rate);
91-
} else if (((sampling_rate > expected_sampling_rate) &&
92-
!computer_.GetFrameOptions().allow_downsample) ||
91+
} else if (((sampling_rate < expected_sampling_rate) &&
92+
computer_.GetFrameOptions().allow_downsample) ||
9393
((sampling_rate > expected_sampling_rate) &&
94-
!computer_.GetFrameOptions().allow_upsample)) {
94+
computer_.GetFrameOptions().allow_upsample)) {
9595
resampler_.reset(new LinearResample(
9696
sampling_rate, expected_sampling_rate,
9797
std::min(sampling_rate / 2, expected_sampling_rate / 2), 6));

0 commit comments

Comments
 (0)