|
|
@ -423,14 +423,13 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, |
|
|
|
private inner class TTSUtteranceListener : UtteranceProgressListener() { |
|
|
|
private inner class TTSUtteranceListener : UtteranceProgressListener() { |
|
|
|
|
|
|
|
|
|
|
|
override fun onStart(s: String) { |
|
|
|
override fun onStart(s: String) { |
|
|
|
postEvent(Bus.TTS_START, readAloudNumber + 1) |
|
|
|
|
|
|
|
textChapter?.let { |
|
|
|
textChapter?.let { |
|
|
|
if (readAloudNumber + 1 > it.getReadLength(pageIndex + 1)) { |
|
|
|
if (readAloudNumber + 1 > it.getReadLength(pageIndex + 1)) { |
|
|
|
pageIndex++ |
|
|
|
pageIndex++ |
|
|
|
postEvent(Bus.TTS_TURN_PAGE, 1) |
|
|
|
postEvent(Bus.TTS_TURN_PAGE, 1) |
|
|
|
postEvent(Bus.TTS_START, readAloudNumber + 1) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
postEvent(Bus.TTS_START, readAloudNumber + 1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onDone(s: String) { |
|
|
|
override fun onDone(s: String) { |
|
|
|