@@ -140,6 +140,9 @@ FsmnVadOnline::Infer(std::vector<float> &waves, bool input_finished) {
return vad_segments;
}
fsmnvad_handle_->Forward(vad_feats, &vad_probs, &in_cache_, input_finished);
+ if(vad_probs.size() == 0){
+ return vad_segments;
+ }
vad_segments = vad_scorer(vad_probs, waves, input_finished, true, vad_silence_duration_, vad_max_len_,
vad_speech_noise_thres_, vad_sample_rate_);
@@ -148,7 +148,7 @@ void FsmnVad::Forward(
vad_inputs.size(), vad_out_names_.data(), vad_out_names_.size());
} catch (std::exception const &e) {
LOG(ERROR) << "Error when run vad onnx forword: " << (e.what());
- exit(-1);
+ return;
// 5. Change infer result to output shapes
@@ -34,9 +34,9 @@
*/
void WaitABit() {
#ifdef WIN32
- Sleep(300);
+ Sleep(500);
#else
- usleep(300);
+ usleep(500);
#endif
std::atomic<int> wav_index(0);