pull/42/head
kunfei 5 years ago
parent 3d21e636dd
commit 382a4a8ab5
  1. 3
      app/src/main/java/io/legado/app/service/HttpReadAloudService.kt

@ -12,6 +12,7 @@ import io.legado.app.utils.getPrefString
import io.legado.app.utils.postEvent
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Job
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import org.jetbrains.anko.toast
import java.io.File
@ -81,6 +82,7 @@ class HttpReadAloudService : BaseReadAloudService(),
job = launch(IO) {
FileHelp.deleteFile(ttsFolder)
for (index in 0 until contentList.size) {
if (isActive) {
val bytes = HttpHelper.getByteRetrofit("http://tts.baidu.com")
.create(IHttpPostApi::class.java)
.postMapByte(
@ -100,6 +102,7 @@ class HttpReadAloudService : BaseReadAloudService(),
}
}
}
}
@Synchronized
private fun playAudio(fd: FileDescriptor) {

Loading…
Cancel
Save