Add C++ runtime for speech enhancement GTCRN models (#1977)

See also https://github.com/Xiaobin-Rong/gtcrn
This commit is contained in:
Fangjun Kuang
2025-03-10 18:11:16 +08:00
committed by GitHub
parent 8aaae91d4a
commit 488a6e687c
20 changed files with 950 additions and 12 deletions

View File

@@ -0,0 +1,31 @@
// sherpa-onnx/csrc/offline-speech-denoiser-gtcrn-model-meta-data.h
//
// Copyright (c) 2025 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_OFFLINE_SPEECH_DENOISER_GTCRN_MODEL_META_DATA_H_
#define SHERPA_ONNX_CSRC_OFFLINE_SPEECH_DENOISER_GTCRN_MODEL_META_DATA_H_
#include <cstdint>
#include <string>
#include <vector>
namespace sherpa_onnx {
// please refer to
// https://github.com/k2-fsa/sherpa-onnx/blob/master/scripts/kokoro/add-meta-data.py
struct OfflineSpeechDenoiserGtcrnModelMetaData {
int32_t sample_rate = 0;
int32_t version = 1;
int32_t n_fft = 0;
int32_t hop_length = 0;
int32_t window_length = 0;
std::string window_type;
std::vector<int64_t> conv_cache_shape;
std::vector<int64_t> tra_cache_shape;
std::vector<int64_t> inter_cache_shape;
};
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_OFFLINE_SPEECH_DENOISER_GTCRN_MODEL_META_DATA_H_