|
|
|
@ -383,7 +383,7 @@ object AgentService : CoroutineScope { |
|
|
|
restartIdleCheck() |
|
|
|
sendEvent("tts_started", mapOf("status" to "started")) |
|
|
|
// 停止气泡音,避免与TTS同时播放 |
|
|
|
// audioPlayer?.stopAudio() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
TtsEventType.SYNTHESIS_COMPLETED -> { |
|
|
|
@ -404,7 +404,7 @@ object AgentService : CoroutineScope { |
|
|
|
restartIdleCheck() |
|
|
|
sendEvent("playback_started", mapOf("status" to "playback_started")) |
|
|
|
// 确保气泡音已停止,避免与TTS播放重叠 |
|
|
|
// audioPlayer?.stopAudio() |
|
|
|
audioPlayer?.stopAudio() |
|
|
|
if(_isInterrupt.get()){ |
|
|
|
BleService.closeCodec() |
|
|
|
} |
|
|
|
@ -1119,7 +1119,7 @@ object AgentService : CoroutineScope { |
|
|
|
if (reply && token.isNotEmpty()) { |
|
|
|
// 发送流式回复token |
|
|
|
sendEvent("assistant_token", mapOf("sessionid" to sessionid,"token" to token)) |
|
|
|
audioPlayer?.stopAudio() |
|
|
|
// audioPlayer?.stopAudio() |
|
|
|
} |
|
|
|
} catch (e: Exception) { |
|
|
|
Log.e(TAG, "liwei--------------- AI Call onToken 异常", e) |
|
|
|
@ -1231,9 +1231,7 @@ object AgentService : CoroutineScope { |
|
|
|
try { |
|
|
|
Log.d( |
|
|
|
TAG, |
|
|
|
"liwei--------------- AI Call onFunctionCallResult ${sessionid}:${functionCallResult.toString()}", |
|
|
|
|
|
|
|
) |
|
|
|
"liwei--------------- AI Call onFunctionCallResult ${sessionid}:${functionCallResult.toString()}",) |
|
|
|
audioPlayer?.stopAudio() |
|
|
|
val name = functionCall.get("name") as String; |
|
|
|
val resultmap = autoHandleFcunCallResult(name, functionCallResult); |
|
|
|
|