Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
fix the issue of concatenating multiple VAD segments for en-bpe
雾聪75be3ceccdf0
diff --git a/funasr/runtime/onnxruntime/src/funasrruntime.cpp b/funasr/runtime/onnxruntime/src/funasrruntime.cppindex 73738c76f..150be704b 100644--- a/funasr/runtime/onnxruntime/src/funasrruntime.cpp+++ b/funasr/runtime/onnxruntime/src/funasrruntime.cpp@@ -257,12 +257,16 @@ extern "C" {int n_total = audio.GetQueueSize();float start_time = 0.0;std::string cur_stamp = "[";+ std::string lang = (offline_stream->asr_handle)->GetLang();while (audio.Fetch(buff, len, flag, start_time) > 0) {string msg = (offline_stream->asr_handle)->Forward(buff, len, true, hw_emb);std::vector<std::string> msg_vec = funasr::split(msg, '|');if(msg_vec.size()==0){continue;}+ if(lang == "en-bpe" and p_result->msg != ""){+ p_result->msg += " ";+ }p_result->msg += msg_vec[0];//timestampif(msg_vec.size() > 1){@@ -282,7 +286,6 @@ extern "C" {p_result->stamp += cur_stamp + "]";}if(offline_stream->UsePunc()){- string lang = (offline_stream->asr_handle)->GetLang();string punc_res = (offline_stream->punc_handle)->AddPunc((p_result->msg).c_str(), lang);p_result->msg = punc_res;}@@ -338,12 +341,16 @@ extern "C" {int n_total = audio.GetQueueSize();float start_time = 0.0;std::string cur_stamp = "[";+ std::string lang = (offline_stream->asr_handle)->GetLang();while (audio.Fetch(buff, len, flag, start_time) > 0) {string msg = (offline_stream->asr_handle)->Forward(buff, len, true, hw_emb);std::vector<std::string> msg_vec = funasr::split(msg, '|');if(msg_vec.size()==0){continue;}+ if(lang == "en-bpe" and p_result->msg != ""){+ p_result->msg += " ";+ }p_result->msg += msg_vec[0];//timestampif(msg_vec.size() > 1){@@ -364,7 +371,6 @@ extern "C" {p_result->stamp += cur_stamp + "]";}if(offline_stream->UsePunc()){- string lang = (offline_stream->asr_handle)->GetLang();string punc_res = (offline_stream->punc_handle)->AddPunc((p_result->msg).c_str(), lang);p_result->msg = punc_res;}