mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
接收hello消息中的features信息
This commit is contained in:
parent
81689c04a5
commit
19526878b3
2 changed files with 6 additions and 0 deletions
|
|
@ -142,6 +142,8 @@ class ConnectionHandler:
|
||||||
) # 在原来第一道关闭的基础上加60秒,进行二道关闭
|
) # 在原来第一道关闭的基础上加60秒,进行二道关闭
|
||||||
|
|
||||||
self.audio_format = "opus"
|
self.audio_format = "opus"
|
||||||
|
# {"mcp":true} 表示启用MCP功能
|
||||||
|
self.features = None
|
||||||
|
|
||||||
async def handle_connection(self, ws):
|
async def handle_connection(self, ws):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ async def handleHelloMessage(conn, msg_json):
|
||||||
if conn.asr is not None:
|
if conn.asr is not None:
|
||||||
conn.asr.set_audio_format(format)
|
conn.asr.set_audio_format(format)
|
||||||
conn.welcome_msg["audio_params"] = audio_params
|
conn.welcome_msg["audio_params"] = audio_params
|
||||||
|
features = msg_json.get("features")
|
||||||
|
if features:
|
||||||
|
conn.logger.bind(tag=TAG).info(f"客户端特性: {features}")
|
||||||
|
conn.features = features
|
||||||
|
|
||||||
await conn.websocket.send(json.dumps(conn.welcome_msg))
|
await conn.websocket.send(json.dumps(conn.welcome_msg))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue