From aff01207754ab3537fc5289db9632c828ea4f016 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 27 Sep 2022 15:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/read/config/SpeakEngineViewModel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineViewModel.kt index 6ee38c74b..2dfe91631 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineViewModel.kt @@ -18,7 +18,12 @@ import io.legado.app.utils.toastOnUi class SpeakEngineViewModel(application: Application) : BaseViewModel(application) { - val sysEngines: List = TextToSpeech(context, null).engines + val sysEngines: List by lazy { + val tts = TextToSpeech(context, null) + val engines = tts.engines + tts.shutdown() + engines + } fun importDefault() { execute {