Browse Source

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

newdev_shunjiawei
lxm 1 year ago
parent
commit
3c90bcfd37
  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) os_log("收到函数调用: %{public}@", log: agentService.logger, type: .info, name)
print("onFunctionCall=functionCall\(functionCall)") print("onFunctionCall=functionCall\(functionCall)")
if (name == "exit_interaction") {
agentService.stopRecognition()
}
try agentService.sendEvent(name: "function_call", data: [ try agentService.sendEvent(name: "function_call", data: [
"name": name, "name": name,
"arguments": functionCall "arguments": functionCall
]) ])
}catch{ }catch{
print("liwei--------------- AI Call onFunctionCall 异常: \(error)") print("liwei--------------- AI Call onFunctionCall 异常: \(error)")
} }
@ -1523,7 +1529,7 @@ class AudioPlayer {
} }
func playStopSound() { func playStopSound() {
// playSound(named: "stop", fileType: "mp3") playSound(named: "stop", fileType: "mp3")
} }
func playCallingSound() { 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)") print("写入数据长度: \(dataToWrite.count)")
self.audioDataCallback!.onAudio(dataToWrite) 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 { if self.recordfile != nil {
// print("写入recordfile数据长度: \(dataToWrite.count)") // print("写入recordfile数据长度: \(dataToWrite.count)")
recordfile?.saveAudioDataToWav(dataToWrite) recordfile?.saveAudioDataToWav(dataToWrite)

Loading…
Cancel
Save