|
|
@ -26,6 +26,7 @@ import java.io.IOException |
|
|
|
import java.net.ConnectException |
|
|
|
import java.net.ConnectException |
|
|
|
import java.net.SocketTimeoutException |
|
|
|
import java.net.SocketTimeoutException |
|
|
|
import java.util.* |
|
|
|
import java.util.* |
|
|
|
|
|
|
|
import javax.script.ScriptException |
|
|
|
|
|
|
|
|
|
|
|
class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
MediaPlayer.OnPreparedListener, |
|
|
|
MediaPlayer.OnPreparedListener, |
|
|
@ -167,6 +168,12 @@ class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
} catch (e: ConcurrentException) { |
|
|
|
} catch (e: ConcurrentException) { |
|
|
|
removeSpeakCache(fileName) |
|
|
|
removeSpeakCache(fileName) |
|
|
|
downloadAudio() |
|
|
|
downloadAudio() |
|
|
|
|
|
|
|
} catch (e: ScriptException) { |
|
|
|
|
|
|
|
AppLog.put("tts接口错误\n${e.localizedMessage}", e) |
|
|
|
|
|
|
|
toastOnUi("js错误\n${e.localizedMessage}") |
|
|
|
|
|
|
|
Timber.e(e) |
|
|
|
|
|
|
|
cancel() |
|
|
|
|
|
|
|
stopSelf() |
|
|
|
} catch (e: SocketTimeoutException) { |
|
|
|
} catch (e: SocketTimeoutException) { |
|
|
|
removeSpeakCache(fileName) |
|
|
|
removeSpeakCache(fileName) |
|
|
|
downloadErrorNo++ |
|
|
|
downloadErrorNo++ |
|
|
|