zhaomingwork
2023-08-21 ca0ada5915b4c71fc4a30db689e0e3646181aebf
fix h5 for timestamp change (#880)

2个文件已修改
3 ■■■■ 已修改文件
funasr/runtime/html5/static/main.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/websocket/websocket-server.cpp 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/html5/static/main.js
@@ -214,7 +214,7 @@
    }
    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++)
funasr/runtime/websocket/websocket-server.cpp
@@ -83,6 +83,7 @@
      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;
      }