|
|
|
@ -1707,14 +1707,16 @@ class ChatApiStreamCallback: StreamCallback { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (responseBuilder.isEmpty) { //关闭声音 |
|
|
|
try agentService.audioPlayer?.stopAwaitSound() |
|
|
|
} |
|
|
|
|
|
|
|
responseBuilder += token |
|
|
|
|
|
|
|
if speakResponse && reply && broadcast{ |
|
|
|
try agentService.azureTtsHelper?.speakStream(sessionid:sessionid,token) |
|
|
|
// 在开始流式TTS时立即停止气泡音 |
|
|
|
} |
|
|
|
if (reply && token != "") { |
|
|
|
try agentService.audioPlayer?.stopAwaitSound() |
|
|
|
try agentService.sendEvent(name: "assistant_token", data: ["sessionid":sessionid,"token": token]) |
|
|
|
} |
|
|
|
}catch { |
|
|
|
|