mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-17 08:41:55 +00:00
android: fix crash when playing recorded voice message (#3325)
* android: fix crash when playing recorded voice message * better
This commit is contained in:
+5
-3
@@ -284,9 +284,11 @@ actual object AudioPlayer: AudioPlayerInterface {
|
||||
kotlin.runCatching {
|
||||
helperPlayer.setDataSource(unencryptedFilePath)
|
||||
helperPlayer.prepare()
|
||||
helperPlayer.start()
|
||||
helperPlayer.stop()
|
||||
res = helperPlayer.duration
|
||||
if (helperPlayer.duration <= 0) {
|
||||
Log.e(TAG, "Duration of audio is incorrect: ${helperPlayer.duration}")
|
||||
} else {
|
||||
res = helperPlayer.duration
|
||||
}
|
||||
helperPlayer.reset()
|
||||
}
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user