Browse Source

修复退出ai聊天界面 是音乐恢复问题

weicu
liwei1dao 10 months ago
parent
commit
3a1bc47127
  1. 2
      local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt
  2. 4
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

2
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")

4
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: [

Loading…
Cancel
Save