|
|
@ -33,6 +33,7 @@ class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
private var task: Coroutine<*>? = null |
|
|
|
private var task: Coroutine<*>? = null |
|
|
|
private var playingIndex = -1 |
|
|
|
private var playingIndex = -1 |
|
|
|
private var playIndexJob: Job? = null |
|
|
|
private var playIndexJob: Job? = null |
|
|
|
|
|
|
|
private var errorNo = 0 |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate() { |
|
|
|
override fun onCreate() { |
|
|
|
super.onCreate() |
|
|
|
super.onCreate() |
|
|
@ -153,6 +154,7 @@ class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
toastOnUi("tts文件解析错误") |
|
|
|
toastOnUi("tts文件解析错误") |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
removeSpeakCacheFile(fileName) |
|
|
|
removeSpeakCacheFile(fileName) |
|
|
|
|
|
|
|
createSpeakFileAsMd5IfNotExist(fileName) |
|
|
|
AppLog.put("tts接口错误\n${e.localizedMessage}", e) |
|
|
|
AppLog.put("tts接口错误\n${e.localizedMessage}", e) |
|
|
|
toastOnUi("tts接口错误\n${e.localizedMessage}") |
|
|
|
toastOnUi("tts接口错误\n${e.localizedMessage}") |
|
|
|
e.printOnDebug() |
|
|
|
e.printOnDebug() |
|
|
@ -279,8 +281,6 @@ class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
upPlayPos() |
|
|
|
upPlayPos() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private var errorNo = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onError(mp: MediaPlayer?, what: Int, extra: Int): Boolean { |
|
|
|
override fun onError(mp: MediaPlayer?, what: Int, extra: Int): Boolean { |
|
|
|
if (what == -38 && extra == 0) { |
|
|
|
if (what == -38 && extra == 0) { |
|
|
|
play() |
|
|
|
play() |
|
|
|