|
|
@ -14,8 +14,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "vad/interface/vad_interface.h"
|
|
|
|
#include "vad/interface/vad_interface.h"
|
|
|
|
#include "common/base/log.h"
|
|
|
|
|
|
|
|
#include "common/base/config.h"
|
|
|
|
#include "common/base/config.h"
|
|
|
|
|
|
|
|
#include "common/base/log.h"
|
|
|
|
#include "vad/nnet/vad.h"
|
|
|
|
#include "vad/nnet/vad.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -25,7 +25,8 @@ PPSHandle_t PPSVadCreateInstance(const char* conf_path) {
|
|
|
|
nnet_conf.sr = conf.Read("sr", 16000);
|
|
|
|
nnet_conf.sr = conf.Read("sr", 16000);
|
|
|
|
nnet_conf.frame_ms = conf.Read("frame_ms", 32);
|
|
|
|
nnet_conf.frame_ms = conf.Read("frame_ms", 32);
|
|
|
|
nnet_conf.threshold = conf.Read("threshold", 0.45f);
|
|
|
|
nnet_conf.threshold = conf.Read("threshold", 0.45f);
|
|
|
|
nnet_conf.min_silence_duration_ms = conf.Read("min_silence_duration_ms", 200);
|
|
|
|
nnet_conf.min_silence_duration_ms =
|
|
|
|
|
|
|
|
conf.Read("min_silence_duration_ms", 200);
|
|
|
|
nnet_conf.speech_pad_left_ms = conf.Read("speech_pad_left_ms", 0);
|
|
|
|
nnet_conf.speech_pad_left_ms = conf.Read("speech_pad_left_ms", 0);
|
|
|
|
nnet_conf.speech_pad_right_ms = conf.Read("speech_pad_right_ms", 0);
|
|
|
|
nnet_conf.speech_pad_right_ms = conf.Read("speech_pad_right_ms", 0);
|
|
|
|
|
|
|
|
|
|
|
@ -72,7 +73,7 @@ PPSVadState_t PPSVadFeedForward(PPSHandle_t instance,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<float> chunk_in(chunk, chunk + num_element);
|
|
|
|
std::vector<float> chunk_in(chunk, chunk + num_element);
|
|
|
|
if (!model->ForwardChunk(chunk_in)){
|
|
|
|
if (!model->ForwardChunk(chunk_in)) {
|
|
|
|
LOG(ERROR) << "forward chunk failed";
|
|
|
|
LOG(ERROR) << "forward chunk failed";
|
|
|
|
return PPS_ILLEGAL;
|
|
|
|
return PPS_ILLEGAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|