diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 94c1ed431..1103c47fa 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -626,10 +626,19 @@ class ChatController extends State ); if (result == null) return; final audioFile = XFile(result.path); + + final bytesResult = await showFutureLoadingDialog( + context: context, + future: audioFile.readAsBytes, + ); + final bytes = bytesResult.result; + if (bytes == null) return; + final file = MatrixAudioFile( - bytes: await audioFile.readAsBytes(), + bytes: bytes, name: result.fileName ?? audioFile.path, ); + await room.sendFileEvent( file, inReplyTo: replyEvent,