[xiaozhi]
[小智向消息盒子发信息]
This commit is contained in:
@@ -3,6 +3,10 @@ package com.mogo.och.common.module.wigets
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.VoiceMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -90,6 +94,14 @@ class ZhiView @JvmOverloads constructor(
|
||||
|
||||
override fun start(reason: String?) {
|
||||
CallerLogger.d(TAG,"-----start $reason")
|
||||
val msg = VoiceMsg(
|
||||
isWakeUp = true,
|
||||
isWakeUpEnd = false,
|
||||
msg = "",
|
||||
isLastMsg = true,
|
||||
isResp = true
|
||||
)
|
||||
pushMsgBox(msg)
|
||||
}
|
||||
|
||||
override fun onStatusChange(status: ZhiRecordWinUi.RecordStatus?) {
|
||||
@@ -130,6 +142,14 @@ class ZhiView @JvmOverloads constructor(
|
||||
CallerLogger.d(TAG,"-----close $trigger")
|
||||
currentAni?.stop()
|
||||
currentAni = normalAnim
|
||||
val msg = VoiceMsg(
|
||||
isWakeUp = false,
|
||||
isWakeUpEnd = true,
|
||||
msg = null,
|
||||
isLastMsg = true,
|
||||
isResp = true
|
||||
)
|
||||
pushMsgBox(msg)
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +162,16 @@ class ZhiView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun showInputText(asrTextBean: AsrTextBean?) {
|
||||
CallerLogger.d(TAG,"-----showInputText $asrTextBean")
|
||||
asrTextBean.let {
|
||||
val msg = VoiceMsg(
|
||||
isWakeUp = false,
|
||||
isWakeUpEnd = false,
|
||||
msg = it?.text,
|
||||
isLastMsg = it?.isLast == true,
|
||||
isResp = false
|
||||
)
|
||||
pushMsgBox(msg)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +187,20 @@ class ZhiView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun showOutputText(outPutText: String?) {
|
||||
CallerLogger.d(TAG,"-----showOutputText $outPutText")
|
||||
outPutText?.let {
|
||||
val msg = VoiceMsg(
|
||||
isWakeUp = false,
|
||||
isWakeUpEnd = false,
|
||||
msg = it,
|
||||
isLastMsg = false,
|
||||
isResp = true
|
||||
)
|
||||
pushMsgBox(msg)
|
||||
}
|
||||
}
|
||||
|
||||
private fun pushMsgBox(msg:VoiceMsg){
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.VOICE, msg))
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user