fix: Record audio on iOS

This commit is contained in:
Christian Pauly 2021-05-07 19:54:32 +02:00
parent 19d51ff1c7
commit cd1e9aeb37

View File

@ -7,7 +7,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:record/record.dart'; import 'package:record/record.dart';
class RecordingDialog extends StatefulWidget { class RecordingDialog extends StatefulWidget {
static const String recordingFileType = 'mp3'; static const String recordingFileType = 'aac';
const RecordingDialog({ const RecordingDialog({
Key key, Key key,
}) : super(key: key); }) : super(key: key);
@ -27,7 +27,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
try { try {
final tempDir = await getTemporaryDirectory(); final tempDir = await getTemporaryDirectory();
_recordedPath = _recordedPath =
'${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}'; '${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}';
final result = await Record.hasPermission(); final result = await Record.hasPermission();
if (result != true) { if (result != true) {