Browse Source

Merge branch 'new_dev' of github.com:deepcloud2048/deep_voice into new_dev

weicu
lxm 1 year ago
parent
commit
89214118ca
  1. 8
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift
  2. 4
      local_plugins/azure_speech/ios/azure_speech/Sources/tools/SimpleAudioReceiver.swift

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

@ -1344,11 +1344,17 @@ class ChatApiStreamCallback: StreamCallback {
os_log("收到函数调用: %{public}@", log: agentService.logger, type: .info, name)
print("onFunctionCall=functionCall\(functionCall)")
if (name == "exit_interaction") {
agentService.stopRecognition()
}
try agentService.sendEvent(name: "function_call", data: [
"name": name,
"arguments": functionCall
])
}catch{
print("liwei--------------- AI Call onFunctionCall 异常: \(error)")
}
@ -1523,7 +1529,7 @@ class AudioPlayer {
}
func playStopSound() {
// playSound(named: "stop", fileType: "mp3")
playSound(named: "stop", fileType: "mp3")
}
func playCallingSound() {

4
local_plugins/azure_speech/ios/azure_speech/Sources/tools/SimpleAudioReceiver.swift

@ -168,7 +168,9 @@ public class SimpleAudioReceiver: NSObject {
print("写入数据长度: \(dataToWrite.count)")
self.audioDataCallback!.onAudio(dataToWrite)
}
try self.pushAudioStream?.write(dataToWrite)
if self.pushAudioStream != nil && self.audioDataCallback == nil {
try self.pushAudioStream?.write(dataToWrite)
}
if self.recordfile != nil {
// print("写入recordfile数据长度: \(dataToWrite.count)")
recordfile?.saveAudioDataToWav(dataToWrite)

Loading…
Cancel
Save