mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 06:25:15 +00:00
chore: More revert recorder
This commit is contained in:
parent
cf574d0b68
commit
bedd4e9ade
4 changed files with 11 additions and 10 deletions
|
@ -31,12 +31,13 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
final _audioRecorder = Record();
|
||||
final List<double> amplitudeTimeline = [];
|
||||
|
||||
static const int bitRate = 16000;
|
||||
static const int bitRate = 64000;
|
||||
static const int samplingRate = 22050;
|
||||
|
||||
Future<void> 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<RecordingDialog> {
|
|||
return;
|
||||
}
|
||||
await WakelockPlus.enable();
|
||||
|
||||
await _audioRecorder.start(
|
||||
path: _recordedPath,
|
||||
bitRate: bitRate,
|
||||
path: path,
|
||||
samplingRate: samplingRate,
|
||||
);
|
||||
setState(() => _duration = Duration.zero);
|
||||
_recorderSubscription?.cancel();
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue