소스 검색

tts报错问题

weizhengliang 1 년 전
부모
커밋
cc632636ac
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      android_mobile/src/main/yd_w_xiaomi_2/code/com/wdkl/ncs/android/component/home/util/SpeechUtil.java

+ 5 - 2
android_mobile/src/main/yd_w_xiaomi_2/code/com/wdkl/ncs/android/component/home/util/SpeechUtil.java

@@ -277,8 +277,11 @@ public class SpeechUtil {
             textToSpeech.shutdown();
             textToSpeech = null;
         }
-        speechThread.interrupt();
-        speechThread = null;
+
+        if (speechThread != null) {
+            speechThread.interrupt();
+            speechThread = null;
+        }
     }
 
     public void startSpeechThread() {