Return timestamp info and tokens in offline ASR

Co-authored-by: zhangbaofeng@npnets.com <41259@Zbf>
This commit is contained in:
cooldoomsday
2023-05-06 10:20:46 +08:00
committed by GitHub
parent 8ce6fff9b6
commit 0bc571f6ee
4 changed files with 14 additions and 4 deletions

View File

@@ -100,10 +100,11 @@ void OfflineWebsocketDecoder::Decode() {
for (int32_t i = 0; i != size; ++i) {
connection_hdl hdl = handles[i];
asio::post(server_->GetConnectionContext(),
[this, hdl, text = ss[i]->GetResult().text]() {
[this, hdl, result = ss[i]->GetResult()]() {
websocketpp::lib::error_code ec;
server_->GetServer().send(
hdl, text, websocketpp::frame::opcode::text, ec);
hdl, result.AsJsonString(),
websocketpp::frame::opcode::text, ec);
if (ec) {
server_->GetServer().get_alog().write(
websocketpp::log::alevel::app, ec.message());