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