chore: always use .wav when recording

This commit is contained in:
ggurdin 2025-06-23 14:06:29 -04:00
parent 931ea3d816
commit df773f8ce2
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -40,14 +40,17 @@ class RecordingDialogState extends State<RecordingDialog> {
Future<void> startRecording() async {
final store = Matrix.of(context).store;
try {
final codec = kIsWeb
// Web seems to create webm instead of ogg when using opus encoder
// which does not play on iOS right now. So we use wav for now:
? AudioEncoder.wav
// Everywhere else we use opus if supported by the platform:
: await _audioRecorder.isEncoderSupported(AudioEncoder.opus)
? AudioEncoder.opus
: AudioEncoder.aacLc;
// #Pangea
// final codec = kIsWeb
// // Web seems to create webm instead of ogg when using opus encoder
// // which does not play on iOS right now. So we use wav for now:
// ? AudioEncoder.wav
// // Everywhere else we use opus if supported by the platform:
// : await _audioRecorder.isEncoderSupported(AudioEncoder.opus)
// ? AudioEncoder.opus
// : AudioEncoder.aacLc;
const codec = AudioEncoder.wav;
// Pangea#
fileName =
'recording${DateTime.now().microsecondsSinceEpoch}.${codec.fileExtension}';
String? path;