update protocol to support manual response mode

This commit is contained in:
Terrence
2024-11-25 00:59:03 +08:00
parent aa806f676e
commit 472219d5bf
11 changed files with 166 additions and 100 deletions

View File

@@ -39,21 +39,6 @@ void WebsocketProtocol::SendText(const std::string& text) {
websocket_->Send(text);
}
void WebsocketProtocol::SendState(const std::string& state) {
std::string message = "{";
message += "\"type\":\"state\",";
message += "\"state\":\"" + state + "\"";
message += "}";
SendText(message);
}
void WebsocketProtocol::SendAbort() {
std::string message = "{";
message += "\"type\":\"abort\"";
message += "}";
SendText(message);
}
bool WebsocketProtocol::IsAudioChannelOpened() const {
return websocket_ != nullptr;
}