Set is_final and start_time for online websocket server. (#342)
* Set is_final and start_time for online websocket server. * Convert timestamps to a json array
This commit is contained in:
@@ -195,9 +195,14 @@ void OnlineWebsocketDecoder::Decode() {
|
||||
for (auto c : c_vec) {
|
||||
auto result = recognizer_->GetResult(c->s.get());
|
||||
if (recognizer_->IsEndpoint(c->s.get())) {
|
||||
result.is_final = true;
|
||||
recognizer_->Reset(c->s.get());
|
||||
}
|
||||
|
||||
if (!recognizer_->IsReady(c->s.get()) && c->eof) {
|
||||
result.is_final = true;
|
||||
}
|
||||
|
||||
asio::post(server_->GetConnectionContext(),
|
||||
[this, hdl = c->hdl, str = result.AsJsonString()]() {
|
||||
server_->Send(hdl, str);
|
||||
|
||||
Reference in New Issue
Block a user