Skip to content

Commit

Permalink
[src] Fix bug in resampling checks for online features (#3639)
Browse files Browse the repository at this point in the history
The --allow-upsample and --allow-downsample options were not handled correctly in the code that handles resampling for computing online features.
  • Loading branch information
entn-at authored and danpovey committed Oct 5, 2019
1 parent 526ade1 commit b5f4cfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/feat/online-feature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ void OnlineGenericBaseFeature<C>::MaybeCreateResampler(
if (resampler_ != nullptr) {
KALDI_ASSERT(resampler_->GetInputSamplingRate() == sampling_rate);
KALDI_ASSERT(resampler_->GetOutputSamplingRate() == expected_sampling_rate);
} else if (((sampling_rate > expected_sampling_rate) &&
!computer_.GetFrameOptions().allow_downsample) ||
} else if (((sampling_rate < expected_sampling_rate) &&
computer_.GetFrameOptions().allow_downsample) ||
((sampling_rate > expected_sampling_rate) &&
!computer_.GetFrameOptions().allow_upsample)) {
computer_.GetFrameOptions().allow_upsample)) {
resampler_.reset(new LinearResample(
sampling_rate, expected_sampling_rate,
std::min(sampling_rate / 2, expected_sampling_rate / 2), 6));
Expand Down

0 comments on commit b5f4cfc

Please sign in to comment.