diff --git a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt index 8d8c5f39f..5cdf939f3 100644 --- a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt @@ -21,6 +21,7 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener companion object { private var textToSpeech: TextToSpeech? = null + private var ttsInitFinish = false fun clearTTS() { textToSpeech?.let { @@ -28,11 +29,10 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener it.shutdown() } textToSpeech = null + ttsInitFinish = false } } - private var ttsInitFinish = false - override fun onCreate() { super.onCreate() textToSpeech = TextToSpeech(this, this)