From 5548e3bdcf67ca4ceb570ac5e9b8032fcadc0334 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 9 Dec 2025 15:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A3=B0=E9=9F=B3=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/agent_service/AgentServiceImpl.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift b/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift index abefc56bc..8db661378 100644 --- a/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift +++ b/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift @@ -1707,14 +1707,16 @@ class ChatApiStreamCallback: StreamCallback { return } + if (responseBuilder.isEmpty) { //关闭声音 + try agentService.audioPlayer?.stopAwaitSound() + } + responseBuilder += token - if speakResponse && reply && broadcast{ try agentService.azureTtsHelper?.speakStream(sessionid:sessionid,token) // 在开始流式TTS时立即停止气泡音 } if (reply && token != "") { - try agentService.audioPlayer?.stopAwaitSound() try agentService.sendEvent(name: "assistant_token", data: ["sessionid":sessionid,"token": token]) } }catch {