From ab4672a5433759625c3a8973dca8d5a0ceaa1637 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 4 Jan 2020 14:53:46 +0800 Subject: [PATCH] up --- .../io/legado/app/service/TTSReadAloudService.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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 cdfd05581..977e8b0ac 100644 --- a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt @@ -45,16 +45,10 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener override fun onInit(status: Int) { launch { if (status == TextToSpeech.SUCCESS) { - val result = textToSpeech?.setLanguage(Locale.CHINA) - if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { - toast(R.string.tts_fix) - IntentHelp.toTTSSetting(this@TTSReadAloudService) - stopSelf() - } else { - textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener()) - ttsIsSuccess = true - play() - } + textToSpeech?.language = Locale.CHINA + textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener()) + ttsIsSuccess = true + play() } else { toast(R.string.tts_init_failed) }