mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 05:45:10 +00:00
build: Update record package
This commit is contained in:
parent
5dfa4c132d
commit
991bba2535
5 changed files with 41 additions and 28 deletions
|
@ -626,7 +626,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await Record().hasPermission() == false) return;
|
if (await AudioRecorder().hasPermission() == false) return;
|
||||||
final result = await showDialog<RecordingResult>(
|
final result = await showDialog<RecordingResult>(
|
||||||
context: context,
|
context: context,
|
||||||
useRootNavigator: false,
|
useRootNavigator: false,
|
||||||
|
|
|
@ -28,7 +28,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
|
|
||||||
bool error = false;
|
bool error = false;
|
||||||
String? _recordedPath;
|
String? _recordedPath;
|
||||||
final _audioRecorder = Record();
|
final _audioRecorder = AudioRecorder();
|
||||||
final List<double> amplitudeTimeline = [];
|
final List<double> amplitudeTimeline = [];
|
||||||
|
|
||||||
static const int bitRate = 64000;
|
static const int bitRate = 64000;
|
||||||
|
@ -37,7 +37,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
Future<void> startRecording() async {
|
Future<void> startRecording() async {
|
||||||
try {
|
try {
|
||||||
final tempDir = await getTemporaryDirectory();
|
final tempDir = await getTemporaryDirectory();
|
||||||
_recordedPath =
|
final path = _recordedPath =
|
||||||
'${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}';
|
'${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}';
|
||||||
|
|
||||||
final result = await _audioRecorder.hasPermission();
|
final result = await _audioRecorder.hasPermission();
|
||||||
|
@ -55,10 +55,15 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
: AudioEncoder.aacLc;
|
: AudioEncoder.aacLc;
|
||||||
|
|
||||||
await _audioRecorder.start(
|
await _audioRecorder.start(
|
||||||
encoder: audioCodec,
|
RecordConfig(
|
||||||
path: _recordedPath,
|
encoder: audioCodec,
|
||||||
bitRate: bitRate,
|
autoGain: true,
|
||||||
samplingRate: samplingRate,
|
noiseSuppress: true,
|
||||||
|
echoCancel: true,
|
||||||
|
bitRate: bitRate,
|
||||||
|
sampleRate: samplingRate,
|
||||||
|
),
|
||||||
|
path: path,
|
||||||
);
|
);
|
||||||
setState(() => _duration = Duration.zero);
|
setState(() => _duration = Duration.zero);
|
||||||
_recorderSubscription?.cancel();
|
_recorderSubscription?.cancel();
|
||||||
|
|
|
@ -24,7 +24,7 @@ import macos_window_utils
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import pasteboard
|
import pasteboard
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import record_macos
|
import record_darwin
|
||||||
import share_plus
|
import share_plus
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
import sqflite
|
import sqflite
|
||||||
|
@ -53,7 +53,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
|
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin"))
|
RecordPlugin.register(with: registry.registrar(forPlugin: "RecordPlugin"))
|
||||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
|
|
44
pubspec.lock
44
pubspec.lock
|
@ -1473,50 +1473,58 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: record
|
name: record
|
||||||
sha256: f703397f5a60d9b2b655b3acc94ba079b2d9a67dc0725bdb90ef2fee2441ebf7
|
sha256: be9b710f42edf94f939dda1a1688e82a68dcd391be0a836c01e639a249f133d3
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.4.4"
|
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"
|
||||||
record_linux:
|
record_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: record_linux
|
name: record_linux
|
||||||
sha256: "348db92c4ec1b67b1b85d791381c8c99d7c6908de141e7c9edc20dad399b15ce"
|
sha256: "7d0e70cd51635128fe9d37d89bafd6011d7cbba9af8dc323079ae60f23546aef"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.1"
|
version: "0.7.1"
|
||||||
record_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: record_macos
|
|
||||||
sha256: d1d0199d1395f05e218207e8cacd03eb9dc9e256ddfe2cfcbbb90e8edea06057
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.2"
|
|
||||||
record_platform_interface:
|
record_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: record_platform_interface
|
name: record_platform_interface
|
||||||
sha256: "7a2d4ce7ac3752505157e416e4e0d666a54b1d5d8601701b7e7e5e30bec181b4"
|
sha256: "3a4b56e94ecd2a0b2b43eb1fa6f94c5b8484334f5d38ef43959c4bf97fb374cf"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "1.0.2"
|
||||||
record_web:
|
record_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: record_web
|
name: record_web
|
||||||
sha256: "219ffb4ca59b4338117857db56d3ffadbde3169bcaf1136f5f4d4656f4a2372d"
|
sha256: f1c0427dcf5af68dcfe06439d04771d65f73bd040eb0dcd98fbe4c02263a7d35
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "1.0.0"
|
||||||
record_windows:
|
record_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: record_windows
|
name: record_windows
|
||||||
sha256: "42d545155a26b20d74f5107648dbb3382dbbc84dc3f1adc767040359e57a1345"
|
sha256: "326bfbe6f5232dd773ad6b848cd94f78148f02557abff1dd4627d056b688dbdb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.1"
|
version: "1.0.0"
|
||||||
remove_emoji:
|
remove_emoji:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -73,7 +73,7 @@ dependencies:
|
||||||
qr_code_scanner: ^1.0.0
|
qr_code_scanner: ^1.0.0
|
||||||
qr_flutter: ^4.0.0
|
qr_flutter: ^4.0.0
|
||||||
receive_sharing_intent: ^1.4.5
|
receive_sharing_intent: ^1.4.5
|
||||||
record: ^4.4.4
|
record: ^5.0.1
|
||||||
scroll_to_index: ^3.0.1
|
scroll_to_index: ^3.0.1
|
||||||
share_plus: ^7.0.0
|
share_plus: ^7.0.0
|
||||||
shared_preferences: ^2.2.0 # Pinned because https://github.com/flutter/flutter/issues/118401
|
shared_preferences: ^2.2.0 # Pinned because https://github.com/flutter/flutter/issues/118401
|
||||||
|
|
Loading…
Reference in a new issue