[Opt3.0]思必驰TTS兼容多语言的API
This commit is contained in:
@@ -29,6 +29,8 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
|||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||||
import com.mogo.tts.base.IMogoTTS;
|
import com.mogo.tts.base.IMogoTTS;
|
||||||
import com.mogo.tts.base.IMogoTTSCallback;
|
import com.mogo.tts.base.IMogoTTSCallback;
|
||||||
|
import com.mogo.tts.base.LangTtsEntity;
|
||||||
|
import com.mogo.tts.base.LanguageType;
|
||||||
import com.mogo.tts.base.MultiLangTtsEntity;
|
import com.mogo.tts.base.MultiLangTtsEntity;
|
||||||
import com.mogo.tts.base.PreemptType;
|
import com.mogo.tts.base.PreemptType;
|
||||||
import com.zhidao.auto.platform.voice.VoiceClient;
|
import com.zhidao.auto.platform.voice.VoiceClient;
|
||||||
@@ -443,9 +445,11 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
|||||||
@MainThread
|
@MainThread
|
||||||
public void speakTTSVoiceWithLevel(String text, int ttsLevel, IMogoTTSCallback callBack) {
|
public void speakTTSVoiceWithLevel(String text, int ttsLevel, IMogoTTSCallback callBack) {
|
||||||
if (mHasAuth && mEngine != null) {
|
if (mHasAuth && mEngine != null) {
|
||||||
mSpeakVoiceMap.put(text, callBack);
|
if (callBack != null) {
|
||||||
|
mSpeakVoiceMap.put(text, callBack);
|
||||||
|
}
|
||||||
|
speakTTSVoiceWithLevel(text, ttsLevel);
|
||||||
}
|
}
|
||||||
speakTTSVoiceWithLevel(text, ttsLevel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 降序插入Tts(目前Level0、1可排队)
|
// 降序插入Tts(目前Level0、1可排队)
|
||||||
@@ -508,7 +512,15 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void speakMultiLangTTSWithLevel(MultiLangTtsEntity ttsEntity, int level, IMogoTTSCallback callback) {
|
public void speakMultiLangTTSWithLevel(MultiLangTtsEntity ttsEntity, int level, IMogoTTSCallback callback) {
|
||||||
|
if (mHasAuth && mEngine != null) {
|
||||||
|
LangTtsEntity entity;
|
||||||
|
if ((entity = ttsEntity.ttsNext()) != null && entity.getLanguage() == LanguageType.CHINESE) {
|
||||||
|
if (callback != null) {
|
||||||
|
mSpeakVoiceMap.put(entity.getTtsContent(), callback);
|
||||||
|
}
|
||||||
|
speakTTSVoiceWithLevel(entity.getTtsContent(), level);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user