diff --git a/sherpa-onnx/csrc/features.cc b/sherpa-onnx/csrc/features.cc index ed90b58a..b0defc50 100644 --- a/sherpa-onnx/csrc/features.cc +++ b/sherpa-onnx/csrc/features.cc @@ -90,7 +90,10 @@ class FeatureExtractor::Impl { return features; } - void Reset() { fbank_ = std::make_unique(opts_); } + void Reset() { + std::lock_guard lock(mutex_); + fbank_ = std::make_unique(opts_); + } int32_t FeatureDim() const { return opts_.mel_opts.num_bins; }