mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-03 22:07:23 +01:00 
			
		
		
		
	Merge branch 'krille/better-audio-message' into 'main'
change: Make audio messages smaller See merge request famedly/fluffychat!654
This commit is contained in:
		
						commit
						0ebf860a8e
					
				@ -173,7 +173,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
 | 
			
		||||
                  ),
 | 
			
		||||
          ),
 | 
			
		||||
          Expanded(
 | 
			
		||||
            child: Slider.adaptive(
 | 
			
		||||
            child: Slider(
 | 
			
		||||
              activeColor: Theme.of(context).colorScheme.secondaryVariant,
 | 
			
		||||
              inactiveColor: widget.color.withAlpha(64),
 | 
			
		||||
              value: currentPosition,
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,9 @@ class _RecordingDialogState extends State<RecordingDialog> {
 | 
			
		||||
  final _audioRecorder = Record();
 | 
			
		||||
  Amplitude _amplitude;
 | 
			
		||||
 | 
			
		||||
  static const int bitRate = 64000;
 | 
			
		||||
  static const double samplingRate = 22050.0;
 | 
			
		||||
 | 
			
		||||
  Future<void> startRecording() async {
 | 
			
		||||
    try {
 | 
			
		||||
      final tempDir = await getTemporaryDirectory();
 | 
			
		||||
@ -43,7 +46,11 @@ class _RecordingDialogState extends State<RecordingDialog> {
 | 
			
		||||
      }
 | 
			
		||||
      await Wakelock.enable();
 | 
			
		||||
      await _audioRecorder.start(
 | 
			
		||||
          path: _recordedPath, encoder: AudioEncoder.AAC);
 | 
			
		||||
        path: _recordedPath,
 | 
			
		||||
        encoder: AudioEncoder.AAC,
 | 
			
		||||
        bitRate: bitRate,
 | 
			
		||||
        samplingRate: samplingRate,
 | 
			
		||||
      );
 | 
			
		||||
      setState(() => _duration = Duration.zero);
 | 
			
		||||
      _recorderSubscription?.cancel();
 | 
			
		||||
      _recorderSubscription =
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user