pull/1395/head
gedoor 3 years ago
parent bd888d0c37
commit d3b5d9c2b8
  1. 3
      app/src/main/java/io/legado/app/service/HttpReadAloudService.kt

@ -281,6 +281,9 @@ class HttpReadAloudService : BaseReadAloudService(),
return@launch return@launch
} }
val speakTextLength = contentList[nowSpeak].length val speakTextLength = contentList[nowSpeak].length
if (speakTextLength <= 0) {
return@launch
}
val sleep = mediaPlayer.duration / speakTextLength val sleep = mediaPlayer.duration / speakTextLength
val start = speakTextLength * mediaPlayer.currentPosition / mediaPlayer.duration val start = speakTextLength * mediaPlayer.currentPosition / mediaPlayer.duration
for (i in start..contentList[nowSpeak].length) { for (i in start..contentList[nowSpeak].length) {

Loading…
Cancel
Save