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
set sleep to 10ms
雾聪8b6aaac4ae86
diff --git a/funasr/runtime/websocket/funasr-wss-client.cpp b/funasr/runtime/websocket/funasr-wss-client.cppindex bf1140b1c..235e709c2 100644--- a/funasr/runtime/websocket/funasr-wss-client.cpp+++ b/funasr/runtime/websocket/funasr-wss-client.cpp@@ -108,16 +108,16 @@ class WebsocketClient {case websocketpp::frame::opcode::text:total_num=total_num+1;LOG(INFO)<< "Thread: " << this_thread::get_id() <<",on_message = " << payload;- // LOG(INFO) << "total_num=" << total_num << " wav_index=" <<wav_index;- // if((total_num+1)==wav_index)- // {- // LOG(INFO) << "close client";- // websocketpp::lib::error_code ec;- // m_client.close(m_hdl, websocketpp::close::status::going_away, "", ec);- // if (ec){- // LOG(ERROR)<< "Error closing connection " << ec.message();- // }- // }+ LOG(INFO) << "total_num=" << total_num << " wav_index=" <<wav_index;+ if((total_num+1)==wav_index)+ {+ LOG(INFO) << "close client";+ websocketpp::lib::error_code ec;+ m_client.close(m_hdl, websocketpp::close::status::going_away, "", ec);+ if (ec){+ LOG(ERROR)<< "Error closing connection " << ec.message();+ }+ }}}@@ -321,7 +321,7 @@ class WebsocketClient {jsonresult["is_speaking"] = false;m_client.send(m_hdl, jsonresult.dump(), websocketpp::frame::opcode::text,ec);- std::this_thread::sleep_for(std::chrono::milliseconds(100));+ std::this_thread::sleep_for(std::chrono::milliseconds(10));}websocketpp::client<T> m_client;