Browse Source

打电话模式去处嘟嘟嘟声音,影响回音消除功能

weicu
fdp 1 year ago
parent
commit
12a36a5fe7
  1. 9
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

9
local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

@ -81,7 +81,7 @@ class AgentServiceImpl: NSObject {
private let maxIdleSeconds: TimeInterval = 10
var micCapture: MicrophoneCapture!
// 语音识别模式
private var currentRecognitionMode: String = "normal"
public var currentRecognitionMode: String = "normal"
internal var audioPlayer: AudioPlayer?
// private var locationInfo:[String: String]?
@ -1581,9 +1581,14 @@ class AudioPlayer {
}
func playAwaitSound() {
// 先停止之前的等待音效和定时器
//先停止之前的等待音效和定时器
stopAwaitSound()
// 修复:通过 agentService 引用访问 currentRecognitionMode
if agentService?.currentRecognitionMode == "phone_call" {//电话模式不要嘟嘟嘟。影响回音消除功能
return
}
// 播放等待音效
playLoopSound(named: "await", fileType: "mp3", player: &awaitPlayer,volume:0.2)

Loading…
Cancel
Save