forked from xiaozhi/xiaozhi-esp32
Add binary protocol v2 & v3 to websocket
This commit is contained in:
@@ -207,6 +207,11 @@ bool MqttProtocol::OpenAudioChannel() {
|
||||
}
|
||||
udp_ = Board::GetInstance().CreateUdp();
|
||||
udp_->OnMessage([this](const std::string& data) {
|
||||
/*
|
||||
* UDP Encrypted OPUS Packet Format:
|
||||
* |type 1u|flags 1u|payload_len 2u|ssrc 4u|timestamp 4u|sequence 4u|
|
||||
* |payload payload_len|
|
||||
*/
|
||||
if (data.size() < sizeof(aes_nonce_)) {
|
||||
ESP_LOGE(TAG, "Invalid audio packet size: %zu", data.size());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user