mirror of
https://github.com/krille-chan/fluffychat
synced 2024-08-11 08:33:44 +00:00
refactor: Change audio codec to opus where supported to have better compatibility with Element
This commit is contained in:
parent
f3798f3ee8
commit
3fb4ad0a83
1 changed files with 9 additions and 0 deletions
|
@ -46,7 +46,16 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
return;
|
||||
}
|
||||
await WakelockPlus.enable();
|
||||
|
||||
// We try to pick Opus where supported, since that is a codec optimized
|
||||
// for speech as well as what the voice messages MSC uses.
|
||||
final audioCodec =
|
||||
(await _audioRecorder.isEncoderSupported(AudioEncoder.opus))
|
||||
? AudioEncoder.opus
|
||||
: AudioEncoder.aacLc;
|
||||
|
||||
await _audioRecorder.start(
|
||||
encoder: audioCodec,
|
||||
path: _recordedPath,
|
||||
bitRate: bitRate,
|
||||
samplingRate: samplingRate,
|
||||
|
|
Loading…
Reference in a new issue