Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix h5 for timestamp change (#880)

zhaomingworkca0ada5915b4
diff --git a/funasr/runtime/html5/static/main.js b/funasr/runtime/html5/static/main.js
index 7e5a49a4f..5cfb89936 100644
--- a/funasr/runtime/html5/static/main.js
+++ b/funasr/runtime/html5/static/main.js
@@ -214,7 +214,7 @@ function handleWithTimestamp(tmptext,tmptime)
}
tmptext=tmptext.replace(/。/g, ","); // in case there are a lot of "。"
var words=tmptext.split(",");
- var jsontime=JSON.parse(tmptime.replace(/\]\]\[\[/g, "],[")); // in case there are a lot segments by VAD
+ var jsontime=JSON.parse(tmptime); //JSON.parse(tmptime.replace(/\]\]\[\[/g, "],[")); // in case there are a lot segments by VAD
var char_index=0;
var text_withtime="";
for(var i=0;i<words.length;i++)
diff --git a/funasr/runtime/websocket/websocket-server.cpp b/funasr/runtime/websocket/websocket-server.cpp
index 952acad7c..16453988d 100644
--- a/funasr/runtime/websocket/websocket-server.cpp
+++ b/funasr/runtime/websocket/websocket-server.cpp
@@ -83,6 +83,7 @@ void WebSocketServer::do_decoder(const std::vector<char>& buffer,
nlohmann::json jsonresult; // result json
jsonresult["text"] = asr_result; // put result in 'text'
jsonresult["mode"] = "offline";
+ jsonresult["is_final"] = false;
if(stamp_res != ""){
jsonresult["timestamp"] = stamp_res;
}