change: Make audio messages smaller

This commit is contained in:
Christian Pauly 2021-12-30 12:43:42 +01:00
parent 20deb45062
commit 968c7868c9
2 changed files with 9 additions and 2 deletions

View File

@ -173,7 +173,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
), ),
), ),
Expanded( Expanded(
child: Slider.adaptive( child: Slider(
activeColor: Theme.of(context).colorScheme.secondaryVariant, activeColor: Theme.of(context).colorScheme.secondaryVariant,
inactiveColor: widget.color.withAlpha(64), inactiveColor: widget.color.withAlpha(64),
value: currentPosition, value: currentPosition,

View File

@ -30,6 +30,9 @@ class _RecordingDialogState extends State<RecordingDialog> {
final _audioRecorder = Record(); final _audioRecorder = Record();
Amplitude _amplitude; Amplitude _amplitude;
static const int bitRate = 64000;
static const double samplingRate = 22050.0;
Future<void> startRecording() async { Future<void> startRecording() async {
try { try {
final tempDir = await getTemporaryDirectory(); final tempDir = await getTemporaryDirectory();
@ -43,7 +46,11 @@ class _RecordingDialogState extends State<RecordingDialog> {
} }
await Wakelock.enable(); await Wakelock.enable();
await _audioRecorder.start( await _audioRecorder.start(
path: _recordedPath, encoder: AudioEncoder.AAC); path: _recordedPath,
encoder: AudioEncoder.AAC,
bitRate: bitRate,
samplingRate: samplingRate,
);
setState(() => _duration = Duration.zero); setState(() => _duration = Duration.zero);
_recorderSubscription?.cancel(); _recorderSubscription?.cancel();
_recorderSubscription = _recorderSubscription =