mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-17 12:06:48 +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:
committed by
GitHub
parent
8d891005d9
commit
e7d6ed66da
+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