diff --git a/runtime/core/frontend/fbank.h b/runtime/core/frontend/fbank.h index f3e1d37211..133cbdb349 100644 --- a/runtime/core/frontend/fbank.h +++ b/runtime/core/frontend/fbank.h @@ -31,6 +31,8 @@ namespace wenet { // This code is based on kaldi Fbank implementation, please see // https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-fbank.cc +static const int kS16AbsMax = 1 << 15; + enum class WindowType { kPovey = 0, kHanning, @@ -265,7 +267,7 @@ class Fbank { if (scale_input_to_unit_) { for (int j = 0; j < frame_length_; ++j) { - data[j] = data[j] / S16_ABS_MAX; + data[j] = data[j] / kS16AbsMax; } }