下沉 tts 功能,分别实现"小智语音"和"小迪语音"
This commit is contained in:
@@ -27,10 +27,10 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
|
||||
AIAssist.startAssistant( v.getContext() );
|
||||
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext() );
|
||||
} else {
|
||||
if ( mDebugModeOpen ) {
|
||||
AIAssist.startAssistant( v.getContext(), 1 );
|
||||
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext(), 1 );
|
||||
return;
|
||||
}
|
||||
if ( mClickCounter == 0 ) {
|
||||
@@ -38,7 +38,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
mClickCounter++;
|
||||
} else {
|
||||
if ( mClickCounter == TOTAL_CLICK_AMOUNT ) {
|
||||
AIAssist.startAssistant( v.getContext(), 2 );
|
||||
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext(), 2 );
|
||||
TipToast.shortTip( "开启语音调试" );
|
||||
mClickCounter = 0;
|
||||
mLastClickTime = 0L;
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
@@ -50,8 +51,19 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
BackToMainHomeManager.addMainHomeView();
|
||||
final String product = DebugConfig.getProductFlavor();
|
||||
if ( product != null ) {
|
||||
switch ( product ) {
|
||||
case "f80x":
|
||||
case "f8xx":
|
||||
BackToMainHomeManager.addMainHomeView();
|
||||
break;
|
||||
case "changanauto":
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
BackToMainHomeManager.addMainHomeView();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
BackToMainHomeManager.init( mServiceApis );
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.mogo.module.tanlu.voice
|
||||
|
||||
import com.zhidao.auto.platform.voice.VoiceClient
|
||||
|
||||
/**
|
||||
* @description 声音控制类
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2019-11-01
|
||||
*/
|
||||
object VoiceController {
|
||||
private lateinit var voiceClient: VoiceClient
|
||||
|
||||
// fun initVoice() {
|
||||
// voiceClient = VoiceClient.getInstance(BaseApplication.getAppContext())
|
||||
// }
|
||||
|
||||
/**
|
||||
* 设置语音命令回调接口
|
||||
* @param callBack
|
||||
*/
|
||||
fun setCallBack(callBack: VoiceClient.VoiceCmdCallBack) {
|
||||
voiceClient.setCallBack(callBack)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param speakText 语音播报内容
|
||||
*/
|
||||
fun speakVoice(speakText: String) {
|
||||
voiceClient.speakDefault(speakText)
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册免唤醒命令
|
||||
* @param customType 命令
|
||||
* @param customWakeupCmd 命令对应的唤醒词集合
|
||||
*/
|
||||
fun registerCustomWakeupCmd(customType: String, customWakeupCmd: Array<String>) {
|
||||
voiceClient.registerCustomWakeupCmd(customType, customWakeupCmd)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消免唤醒命令
|
||||
* @param customType 命令
|
||||
*/
|
||||
fun unRegisterCustomWakeupCmd(customType: String) {
|
||||
voiceClient.unRegisterCustomWakeupCmd(customType)
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放资源(界面销毁的时候调用)
|
||||
*/
|
||||
fun release() {
|
||||
voiceClient.release()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user