From fd22b4330efc3bf7ed73c3ca353f77a4ead8e256 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 29 Oct 2023 13:04:45 +0100 Subject: [PATCH] chore: Downgrade record --- lib/pages/chat/chat.dart | 2 +- lib/pages/chat/recording_dialog.dart | 9 +--- macos/Flutter/GeneratedPluginRegistrant.swift | 4 +- pubspec.lock | 44 ++++++++----------- pubspec.yaml | 2 +- 5 files changed, 24 insertions(+), 37 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 59f3063c..b2b2c12f 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -621,7 +621,7 @@ class ChatController extends State { } } - if (await AudioRecorder().hasPermission() == false) return; + if (await Record().hasPermission() == false) return; final result = await showDialog( context: context, barrierDismissible: false, diff --git a/lib/pages/chat/recording_dialog.dart b/lib/pages/chat/recording_dialog.dart index f65e9b95..0b5acec4 100644 --- a/lib/pages/chat/recording_dialog.dart +++ b/lib/pages/chat/recording_dialog.dart @@ -28,7 +28,7 @@ class RecordingDialogState extends State { bool error = false; String? _recordedPath; - final _audioRecorder = AudioRecorder(); + final _audioRecorder = Record(); final List amplitudeTimeline = []; static const int bitRate = 16000; @@ -47,12 +47,7 @@ class RecordingDialogState extends State { await WakelockPlus.enable(); await _audioRecorder.start( - const RecordConfig( - autoGain: true, - noiseSuppress: true, - echoCancel: true, - bitRate: bitRate, - ), + bitRate: bitRate, path: path, ); setState(() => _duration = Duration.zero); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8f5de20f..e47880af 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -24,7 +24,7 @@ import macos_window_utils import package_info_plus import pasteboard import path_provider_foundation -import record_darwin +import record_macos import share_plus import shared_preferences_foundation import sqflite @@ -53,7 +53,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - RecordPlugin.register(with: registry.registrar(forPlugin: "RecordPlugin")) + RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 969c4c15..fef69521 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1473,58 +1473,50 @@ packages: dependency: "direct main" description: name: record - sha256: be9b710f42edf94f939dda1a1688e82a68dcd391be0a836c01e639a249f133d3 + sha256: f703397f5a60d9b2b655b3acc94ba079b2d9a67dc0725bdb90ef2fee2441ebf7 url: "https://pub.dev" source: hosted - version: "5.0.1" - record_android: - dependency: transitive - description: - name: record_android - sha256: f2d72c8e86d275967b9e9d1ced58c775958b94d3e2dac3d5416df46d23924ade - url: "https://pub.dev" - source: hosted - version: "1.0.2" - record_darwin: - dependency: transitive - description: - name: record_darwin - sha256: "78dba641ae271e555035ee68b637f7605ba9f8c60ccfd5c03b835e0b77ea201f" - url: "https://pub.dev" - source: hosted - version: "1.0.0" + version: "4.4.4" record_linux: dependency: transitive description: name: record_linux - sha256: "7d0e70cd51635128fe9d37d89bafd6011d7cbba9af8dc323079ae60f23546aef" + sha256: "348db92c4ec1b67b1b85d791381c8c99d7c6908de141e7c9edc20dad399b15ce" url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.4.1" + record_macos: + dependency: transitive + description: + name: record_macos + sha256: d1d0199d1395f05e218207e8cacd03eb9dc9e256ddfe2cfcbbb90e8edea06057 + url: "https://pub.dev" + source: hosted + version: "0.2.2" record_platform_interface: dependency: transitive description: name: record_platform_interface - sha256: "3a4b56e94ecd2a0b2b43eb1fa6f94c5b8484334f5d38ef43959c4bf97fb374cf" + sha256: "7a2d4ce7ac3752505157e416e4e0d666a54b1d5d8601701b7e7e5e30bec181b4" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "0.5.0" record_web: dependency: transitive description: name: record_web - sha256: f1c0427dcf5af68dcfe06439d04771d65f73bd040eb0dcd98fbe4c02263a7d35 + sha256: "219ffb4ca59b4338117857db56d3ffadbde3169bcaf1136f5f4d4656f4a2372d" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "0.5.0" record_windows: dependency: transitive description: name: record_windows - sha256: "326bfbe6f5232dd773ad6b848cd94f78148f02557abff1dd4627d056b688dbdb" + sha256: "42d545155a26b20d74f5107648dbb3382dbbc84dc3f1adc767040359e57a1345" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "0.7.1" remove_emoji: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index bd47c2ac..f9afb096 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -74,7 +74,7 @@ dependencies: qr_code_scanner: ^1.0.0 qr_flutter: ^4.0.0 receive_sharing_intent: ^1.4.5 - record: ^5.0.1 + record: ^4.4.4 scroll_to_index: ^3.0.1 share_plus: ^7.0.0 shared_preferences: ^2.2.0 # Pinned because https://github.com/flutter/flutter/issues/118401