Explorar el Código

fix badcase for empty files

雾聪 hace 2 años
padre
commit
57558b4a7d
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      funasr/runtime/onnxruntime/src/funasrruntime.cpp

+ 3 - 0
funasr/runtime/onnxruntime/src/funasrruntime.cpp

@@ -227,6 +227,9 @@ extern "C" {
 		int n_total = audio.GetQueueSize();
 		funasr::FUNASR_RECOG_RESULT* p_result = new funasr::FUNASR_RECOG_RESULT;
 		p_result->snippet_time = audio.GetTimeLen();
+		if(p_result->snippet_time == 0){
+            return p_result;
+        }
 		while (audio.Fetch(buff, len, flag) > 0) {
 			string msg = (offline_stream->asr_handle)->Forward(buff, len, flag);
 			p_result->msg+= msg;