wangzhibo
2026-09-11 659c470eba542383987aad227b7f918100f131fa
xiaozhi-esp32-server/main/xiaozhi-server/core/handle/helloHandle.py
@@ -14,6 +14,7 @@
from core.handle.sendAudioHandle import sendAudioMessage, send_tts_message
from core.utils.util import remove_punctuation_and_length, opus_datas_to_wav_bytes
from core.providers.tools.device_mcp import MCPClient, send_mcp_initialize_message
from core.websocket_handshake import merge_hello_audio_params
TAG = __name__
@@ -46,7 +47,12 @@
        format = audio_params.get("format")
        conn.logger.bind(tag=TAG).debug(f"客户端音频格式: {format}")
        conn.audio_format = format
        conn.welcome_msg["audio_params"] = audio_params
        conn.welcome_msg["audio_params"] = merge_hello_audio_params(
            conn.welcome_msg.get("audio_params"), audio_params
        )
        output_rate = (conn.welcome_msg.get("audio_params") or {}).get("sample_rate")
        if output_rate:
            conn.sample_rate = output_rate
    features = msg_json.get("features")
    if features:
        conn.logger.bind(tag=TAG).debug(f"客户端特性: {features}")