From a93c0d45c1dfd0d22712812d1d06274e4eeb1386 Mon Sep 17 00:00:00 2001 From: EmArrow Date: Thu, 4 Jul 2024 14:04:24 +0800 Subject: [PATCH] [6.5.0] add voice --- .../function/business/roadcross/RoadCrossCameraManager.kt | 2 ++ .../mogo/eagle/core/function/view/RoadCrossRoamView.kt | 4 ++++ .../function/call/map/CallerMapRoadListenerManager.kt | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/roadcross/RoadCrossCameraManager.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/roadcross/RoadCrossCameraManager.kt index 75c4f9b6e8..c9e210814a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/roadcross/RoadCrossCameraManager.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/roadcross/RoadCrossCameraManager.kt @@ -6,6 +6,7 @@ import android.os.Handler import android.os.Looper import android.os.Message import com.mogo.commons.debug.DebugConfig +import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.road.CameraDeviceInfo import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener @@ -66,6 +67,7 @@ class RoadCrossCameraManager : IMoGoMapRoadListener { "$M_MAP$TAG", "触发接口调用 dis: $distance , roadCrossEnd: ${roadCrossEnd ?: "null"} " ) + AIAssist.getInstance(mContext).speakTTSVoice("蘑菇检测到前方${distance.toInt()}米您将通过路口,已为您切换展示路口全息影像") if (roadCrossEnd != null) { ndeRoadCameraNetWorkModel.getRoadCrossInfo(roadCrossEnd, onSuccess = { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/RoadCrossRoamView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/RoadCrossRoamView.kt index 60ea614bb2..b94e915052 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/RoadCrossRoamView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/RoadCrossRoamView.kt @@ -12,6 +12,7 @@ import android.view.animation.LinearInterpolator import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager @@ -112,6 +113,9 @@ class RoadCrossRoamView @JvmOverloads constructor( ivZhiRoadRoamView.visibility = View.VISIBLE mapRoamView.visibility = View.VISIBLE mapRoamView.openRoam() + //播放语音 + val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0 + AIAssist.getInstance(context).speakTTSVoice("前方${dis}米将通过路口,蘑菇为您提供路口全息影像,助力出行") lvRoadCrossRoamTip.adapter = RoadCrossRoamListAdapter(context, lightMode) // 创建横向移动的动画 if (animator == null) { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapRoadListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapRoadListenerManager.kt index 17c4344fcd..2d9fc384cb 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapRoadListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapRoadListenerManager.kt @@ -70,6 +70,14 @@ object CallerMapRoadListenerManager : CallerBase() { } } + fun getStopLineDistance(): Double? { + return if (mStopLine == null) { + null + } else { + mStopLine!!.distance + } + } + @ChainLog( linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, linkCode = ChainConstant.CHAIN_SOURCE_MAP,