|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package io.legado.app.service |
|
|
|
|
|
|
|
|
|
import android.app.PendingIntent |
|
|
|
|
import android.content.Intent |
|
|
|
|
import android.speech.tts.TextToSpeech |
|
|
|
|
import android.speech.tts.UtteranceProgressListener |
|
|
|
|
import io.legado.app.R |
|
|
|
@ -40,6 +41,12 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener |
|
|
|
|
upSpeechRate() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onTaskRemoved(rootIntent: Intent?) { |
|
|
|
|
super.onTaskRemoved(rootIntent) |
|
|
|
|
clearTTS() |
|
|
|
|
stopSelf() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun initTts() { |
|
|
|
|
ttsInitFinish = false |
|
|
|
|
textToSpeech = TextToSpeech(this, this) |
|
|
|
|