| | |
| | | // |
| | | // Created by root on 4/9/23. |
| | | // |
| | | |
| | | #include <fstream> |
| | | #include "FsmnVad.h" |
| | | #include "precomp.h" |
| | |
| | | |
| | | void FsmnVad::init_vad(const std::string &vad_model, const std::string &vad_cmvn, int vad_sample_rate, int vad_silence_duration, int vad_max_len, |
| | | float vad_speech_noise_thres) { |
| | | |
| | | |
| | | session_options_.SetIntraOpNumThreads(1); |
| | | session_options_.SetGraphOptimizationLevel(ORT_ENABLE_ALL); |
| | | session_options_.DisableCpuMemArena(); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | void FsmnVad::read_model(const std::string &vad_model) { |
| | | try { |
| | | vad_session_ = std::make_shared<Ort::Session>( |
| | |
| | | //LOG(INFO) << "vad onnx:"; |
| | | GetInputOutputInfo(vad_session_, &vad_in_names_, &vad_out_names_); |
| | | } |
| | | |
| | | |
| | | |
| | | void FsmnVad::GetInputOutputInfo( |
| | | const std::shared_ptr<Ort::Session> &session, |