|
|
@ -97,9 +97,14 @@ class HttpReadAloudService : BaseReadAloudService(), |
|
|
|
private fun playAudio(fd: FileDescriptor) { |
|
|
|
private fun playAudio(fd: FileDescriptor) { |
|
|
|
if (playingIndex != nowSpeak) { |
|
|
|
if (playingIndex != nowSpeak) { |
|
|
|
playingIndex = nowSpeak |
|
|
|
playingIndex = nowSpeak |
|
|
|
mediaPlayer.reset() |
|
|
|
try { |
|
|
|
mediaPlayer.setDataSource(fd) |
|
|
|
mediaPlayer.reset() |
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
mediaPlayer.setDataSource(fd) |
|
|
|
|
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
e.printStackTrace() |
|
|
|
|
|
|
|
toast(e.localizedMessage) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|