feat: 优化

pull/209/head
kunfei 5 years ago
parent 1e30b0053d
commit 563636cea2
  1. 9
      app/src/main/java/io/legado/app/service/TTSReadAloudService.kt

@ -35,10 +35,15 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
override fun onCreate() {
super.onCreate()
textToSpeech = TextToSpeech(this, this)
initTts()
upSpeechRate()
}
private fun initTts() {
ttsInitFinish = false
textToSpeech = TextToSpeech(this, this)
}
override fun onDestroy() {
super.onDestroy()
clearTTS()
@ -98,7 +103,7 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
if (this.getPrefBoolean("ttsFollowSys", true)) {
if (reset) {
clearTTS()
textToSpeech = TextToSpeech(this, this)
initTts()
}
} else {
textToSpeech?.setSpeechRate((AppConfig.ttsSpeechRate + 5) / 10f)

Loading…
Cancel
Save