Add timestamps for streaming ASR. (#123)

This commit is contained in:
Fangjun Kuang
2023-04-19 16:02:37 +08:00
committed by GitHub
parent 4b5d2887cb
commit ad05f52666
11 changed files with 170 additions and 19 deletions

View File

@@ -196,7 +196,7 @@ void OnlineWebsocketDecoder::Decode() {
auto result = recognizer_->GetResult(c->s.get());
asio::post(server_->GetConnectionContext(),
[this, hdl = c->hdl, str = result.ToString()]() {
[this, hdl = c->hdl, str = result.AsJsonString()]() {
server_->Send(hdl, str);
});
active_.erase(c->hdl);