diff --git a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt index 961f578be..acbd4f4f1 100644 --- a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt +++ b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt @@ -1210,7 +1210,7 @@ object AgentService : CoroutineScope { if (name == "exit_interaction") { BleService.closeCodec() stopRecognition() - }else if (name == "qqmusic_pause" || name == "music_pause"){ + }else if (name == "qqmusic_pause" || name == "qqmusic_stop" || name == "music_pause" || name == "music_close"){ isplaymusic = false } Log.d(TAG, "liwei--------------- AI Call onFunctionCall iscallingTool:$iscallingTool callingToolText:$callingToolText") 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 436a17151..6d4d9583d 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 @@ -39,7 +39,7 @@ class AgentServiceImpl: NSObject { private var config: [String: Any] = [:] // 添加音乐播放状态记录 - private var wasMusicPlayingBeforeRecognition: Bool = false + public var wasMusicPlayingBeforeRecognition: Bool = false private var isSpeaking: Bool = false @@ -1811,6 +1811,8 @@ class ChatApiStreamCallback: StreamCallback { // 关闭编码器 (设备侧) BleService.shared.closeCodec() agentService.stopRecognition() + }else if (name == "qqmusic_pause" || name == "qqmusic_stop" || name == "music_pause" || name == "music_close"){ // + agentService.wasMusicPlayingBeforeRecognition = false } try agentService.sendEvent(name: "function_call", data: [