From bedd4e9ade4e84f7d6ae699bb6d47c89e0179c50 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 29 Oct 2023 13:56:36 +0100 Subject: [PATCH] chore: More revert recorder --- lib/pages/chat/recording_dialog.dart | 9 +++++---- macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- pubspec.lock | 8 ++++---- pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/pages/chat/recording_dialog.dart b/lib/pages/chat/recording_dialog.dart index 0b5acec4..300d5d9b 100644 --- a/lib/pages/chat/recording_dialog.dart +++ b/lib/pages/chat/recording_dialog.dart @@ -31,12 +31,13 @@ class RecordingDialogState extends State { final _audioRecorder = Record(); final List amplitudeTimeline = []; - static const int bitRate = 16000; + static const int bitRate = 64000; + static const int samplingRate = 22050; Future startRecording() async { try { final tempDir = await getTemporaryDirectory(); - final path = _recordedPath = + _recordedPath = '${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}'; final result = await _audioRecorder.hasPermission(); @@ -45,10 +46,10 @@ class RecordingDialogState extends State { return; } await WakelockPlus.enable(); - await _audioRecorder.start( + path: _recordedPath, bitRate: bitRate, - path: path, + samplingRate: samplingRate, ); setState(() => _duration = Duration.zero); _recorderSubscription?.cancel(); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e47880af..8ccdbb83 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -50,7 +50,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) MacOSUiPlugin.register(with: registry.registrar(forPlugin: "MacOSUiPlugin")) MacOSWindowUtilsPlugin.register(with: registry.registrar(forPlugin: "MacOSWindowUtilsPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin")) diff --git a/pubspec.lock b/pubspec.lock index fef69521..818c6e09 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1193,10 +1193,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: @@ -2046,10 +2046,10 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: aac3f3258f01781ec9212df94eecef1eb9ba9350e106728def405baa096ba413 + sha256: f45a6c03aa3f8322e0a9d7f4a0482721c8789cb41d555407367650b8f9c26018 url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.3" wakelock_plus_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f9afb096..9c01ea5b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -88,7 +88,7 @@ dependencies: vibration: ^1.7.4-nullsafety.0 video_compress: ^3.1.1 video_player: ^2.2.18 - wakelock_plus: ^1.1.1 + wakelock_plus: ^1.1.3 webrtc_interface: ^1.0.13 dev_dependencies: