diff --git a/speechx/examples/feat/linear_spectrogram_main.cc b/speechx/examples/feat/linear_spectrogram_main.cc index 8f32bac2..ca76d85c 100644 --- a/speechx/examples/feat/linear_spectrogram_main.cc +++ b/speechx/examples/feat/linear_spectrogram_main.cc @@ -20,11 +20,11 @@ #include "kaldi/util/kaldi-io.h" #include "kaldi/util/table-types.h" -#include "frontend/audio/linear_spectrogram.h" #include "frontend/audio/audio_cache.h" #include "frontend/audio/data_cache.h" #include "frontend/audio/feature_cache.h" #include "frontend/audio/frontend_itf.h" +#include "frontend/audio/linear_spectrogram.h" #include "frontend/audio/normalizer.h" DEFINE_string(wav_rspecifier, "", "test wav scp path"); @@ -187,9 +187,8 @@ int main(int argc, char* argv[]) { std::unique_ptr linear_spectrogram( new ppspeech::LinearSpectrogram(opt, std::move(db_norm))); - std::unique_ptr cmvn( - new ppspeech::CMVN(FLAGS_cmvn_write_path, - std::move(linear_spectrogram))); + std::unique_ptr cmvn(new ppspeech::CMVN( + FLAGS_cmvn_write_path, std::move(linear_spectrogram))); ppspeech::FeatureCache feature_cache(kint16max, std::move(cmvn)); LOG(INFO) << "feat dim: " << feature_cache.Dim(); diff --git a/speechx/speechx/frontend/audio/cmvn.cc b/speechx/speechx/frontend/audio/cmvn.cc index 706492b7..4c1ffd6a 100644 --- a/speechx/speechx/frontend/audio/cmvn.cc +++ b/speechx/speechx/frontend/audio/cmvn.cc @@ -1,3 +1,17 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #include "frontend/audio/cmvn.h" #include "kaldi/feat/cmvn.h" @@ -13,8 +27,7 @@ using kaldi::SubVector; using std::unique_ptr; -CMVN::CMVN(std::string cmvn_file, - unique_ptr base_extractor) +CMVN::CMVN(std::string cmvn_file, unique_ptr base_extractor) : var_norm_(true) { base_extractor_ = std::move(base_extractor); bool binary; diff --git a/speechx/speechx/frontend/audio/cmvn.h b/speechx/speechx/frontend/audio/cmvn.h index b3cfbb11..50ef5649 100644 --- a/speechx/speechx/frontend/audio/cmvn.h +++ b/speechx/speechx/frontend/audio/cmvn.h @@ -1,3 +1,17 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once #include "base/common.h" diff --git a/speechx/speechx/frontend/audio/feature_cache.cc b/speechx/speechx/frontend/audio/feature_cache.cc index d7bea61a..3f7f6502 100644 --- a/speechx/speechx/frontend/audio/feature_cache.cc +++ b/speechx/speechx/frontend/audio/feature_cache.cc @@ -23,8 +23,8 @@ using std::vector; using kaldi::SubVector; using std::unique_ptr; -FeatureCache::FeatureCache( - int max_size, unique_ptr base_extractor) { +FeatureCache::FeatureCache(int max_size, + unique_ptr base_extractor) { max_size_ = max_size; base_extractor_ = std::move(base_extractor); } diff --git a/speechx/speechx/frontend/audio/normalizer.h b/speechx/speechx/frontend/audio/normalizer.h index df9e4b75..dcf721dd 100644 --- a/speechx/speechx/frontend/audio/normalizer.h +++ b/speechx/speechx/frontend/audio/normalizer.h @@ -1,3 +1,17 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once #include "frontend/audio/cmvn.h" diff --git a/speechx/speechx/nnet/decodable.h b/speechx/speechx/nnet/decodable.h index c75a0f4d..3f0aab04 100644 --- a/speechx/speechx/nnet/decodable.h +++ b/speechx/speechx/nnet/decodable.h @@ -24,9 +24,8 @@ struct DecodableOpts; class Decodable : public kaldi::DecodableInterface { public: - explicit Decodable( - const std::shared_ptr& nnet, - const std::shared_ptr& frontend); + explicit Decodable(const std::shared_ptr& nnet, + const std::shared_ptr& frontend); // void Init(DecodableOpts config); virtual kaldi::BaseFloat LogLikelihood(int32 frame, int32 index); virtual bool IsLastFrame(int32 frame) const;