mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +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;
|
return;
|
||||||
}
|
}
|
||||||
await WakelockPlus.enable();
|
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(
|
await _audioRecorder.start(
|
||||||
|
encoder: audioCodec,
|
||||||
path: _recordedPath,
|
path: _recordedPath,
|
||||||
bitRate: bitRate,
|
bitRate: bitRate,
|
||||||
samplingRate: samplingRate,
|
samplingRate: samplingRate,
|
||||||
|
|
Loading…
Reference in a new issue