mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2025-05-17 15:20:29 +08:00
Add session_id to websocket message
This commit is contained in:
@ -222,6 +222,12 @@ void WebsocketProtocol::ParseServerHello(const cJSON* root) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto session_id = cJSON_GetObjectItem(root, "session_id");
|
||||||
|
if (session_id != nullptr) {
|
||||||
|
session_id_ = session_id->valuestring;
|
||||||
|
ESP_LOGI(TAG, "Session ID: %s", session_id_.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
auto audio_params = cJSON_GetObjectItem(root, "audio_params");
|
auto audio_params = cJSON_GetObjectItem(root, "audio_params");
|
||||||
if (audio_params != NULL) {
|
if (audio_params != NULL) {
|
||||||
auto sample_rate = cJSON_GetObjectItem(audio_params, "sample_rate");
|
auto sample_rate = cJSON_GetObjectItem(audio_params, "sample_rate");
|
||||||
|
Reference in New Issue
Block a user