From 57558b4a7df571dd74dc1e23b694a23bb63249f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E8=81=AA?= Date: Sun, 25 Jun 2023 22:50:09 +0800 Subject: [PATCH] fix badcase for empty files --- funasr/runtime/onnxruntime/src/funasrruntime.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/funasr/runtime/onnxruntime/src/funasrruntime.cpp b/funasr/runtime/onnxruntime/src/funasrruntime.cpp index f504b39f0..f41c71a1b 100644 --- a/funasr/runtime/onnxruntime/src/funasrruntime.cpp +++ b/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;