Skip to content

Commit

Permalink
fix: Audiomessages on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Oct 29, 2023
1 parent 3a9c6e8 commit b96bc45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 4 additions & 1 deletion lib/pages/chat/recording_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
import 'package:path_provider/path_provider.dart';
import 'package:record/record.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
Expand All @@ -30,7 +31,8 @@ class RecordingDialogState extends State<RecordingDialog> {
final _audioRecorder = AudioRecorder();
final List<double> amplitudeTimeline = [];

static const int bitRate = 16000;
static const int bitRate =
64000; // Lower makes the audio messages unplayable on iOS for some reason

Future<void> startRecording() async {
try {
Expand All @@ -46,6 +48,7 @@ class RecordingDialogState extends State<RecordingDialog> {
final path = _recordedPath =
'${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.$fileExtension';

Logs().v('Store audio file at', path);
final result = await _audioRecorder.hasPermission();
if (result != true) {
setState(() => error = true);
Expand Down

0 comments on commit b96bc45

Please sign in to comment.