Merge branch 'hotfix_6.4.0.1' into dev_robobus-d_240521_6.4.1

This commit is contained in:
renwj
2024-05-21 15:39:14 +08:00
5 changed files with 28 additions and 3 deletions

View File

@@ -114,6 +114,17 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
}
}
override fun onStopTts(speakText: String?) {
super.onStopTts(speakText)
listeners
.filter {
it.get() != null
}
.forEach {
it.get()?.onSpeakEnd()
}
}
override fun register() {
if (hasRegister.get()) {
return

View File

@@ -167,6 +167,11 @@ class MoGoHmiProvider : IMoGoHmiProvider {
super.onSpeakError(speakText, errorMsg)
isPlayingTts.set(false)
}
override fun onStopTts(speakText: String?) {
super.onStopTts(speakText)
isPlayingTts.set(false)
}
})
isPlayingTts.set(true)
}

View File

@@ -74,6 +74,9 @@ interface IMogoTTSCallback {
default void onSpeakEnd( String speakText ) {
}
default void onStopTts( String speakText ) {
}
default void onSpeakError( String speakText, String errorMsg) {
}

View File

@@ -156,7 +156,7 @@ class IFlyTekTts : IMogoTTS, InitListener {
curTtsEntity?.let {
val string = it.toString()
if (speakVoiceMap.containsKey(string)) {
speakVoiceMap.remove(string)
speakVoiceMap.remove(string)?.onStopTts(string)
}
curTtsEntity = null
}

View File

@@ -357,7 +357,10 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack {
public void stopSpeakTts(String text) {
if (mEngine != null && mHasAuth) {
mSpeakVoiceMap.remove(text);
IMogoTTSCallback callBack = mSpeakVoiceMap.remove(text);
if (callBack != null) {
callBack.onStopTts(curTtsContent);
}
curTtsContent = "";
curTtsLevel = -1;
mEngine.stop();
@@ -366,7 +369,10 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack {
public void stopTts() {
if (mEngine != null && mHasAuth) {
mSpeakVoiceMap.remove(curTtsContent);
IMogoTTSCallback callBack = mSpeakVoiceMap.remove(curTtsContent);
if (callBack != null) {
callBack.onStopTts(curTtsContent);
}
// tts过程中调用stop不会有回调事件
curTtsContent = "";
curTtsLevel = -1;