Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
# Conflicts: # app/build.gradle # app/src/main/AndroidManifest.xml # core/mogo-core-function-call/build.gradle
This commit is contained in:
@@ -6,6 +6,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.tts.base.IMogoTTS;
|
||||
import com.mogo.tts.base.IMogoTTSCallback;
|
||||
import com.mogo.tts.base.MultiLangTtsEntity;
|
||||
import com.mogo.tts.base.PreemptType;
|
||||
|
||||
/**
|
||||
@@ -52,7 +53,9 @@ public class AIAssist {
|
||||
private AIAssist(Context context) {
|
||||
try {
|
||||
// 暂时换成反射,解决死锁问题
|
||||
// TODO:("支持切换思必驰和科大讯飞")
|
||||
Class<?> clazz = Class.forName("com.mogo.tts.pad.PadTTS");
|
||||
// Class<?> clazz = Class.forName("com.mogo.tts.iflytek.IFlyTekTts");
|
||||
mTTS = (IMogoTTS) clazz.getConstructor().newInstance();
|
||||
mTTS.init(context);
|
||||
// mTTS = (IMogoTTS) ARouter.getInstance().build(MogoTTSConstants.API_PATH).navigation(context.getApplicationContext());
|
||||
@@ -122,6 +125,18 @@ public class AIAssist {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支持多语言的Tts
|
||||
* @param ttsEntity: 多语言Entity
|
||||
* @param level: 等级由低到高为0、1、2、3,分别对应p3、p2、p1、p0
|
||||
* @param callback
|
||||
*/
|
||||
public void speakMultiLangTTSWithLevel(MultiLangTtsEntity ttsEntity, int level, IMogoTTSCallback callback) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakMultiLangTTSWithLevel(ttsEntity, level, callback);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音播报
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user