Support sending is_eof for online websocket server. (#2204)

is_final=true means an endpoint is detected.

is_eof=true means all received samples have been processed
by the server.
This commit is contained in:
Fangjun Kuang
2025-05-13 14:49:22 +08:00
committed by GitHub
parent cf67d72c22
commit 9a0e16f092
3 changed files with 10 additions and 2 deletions

View File

@@ -77,7 +77,8 @@ std::string OnlineRecognizerResult::AsJsonString() const {
os << "\"words\": " << VecToString(words, 0) << ", ";
os << "\"start_time\": " << std::fixed << std::setprecision(2) << start_time
<< ", ";
os << "\"is_final\": " << (is_final ? "true" : "false");
os << "\"is_final\": " << (is_final ? "true" : "false") << ", ";
os << "\"is_eof\": " << (is_eof ? "true" : "false");
os << "}";
return os.str();
}