Merge pull request #70 from pangeachat/audio-fix
updated recording package
This commit is contained in:
commit
88e7922a73
5 changed files with 57 additions and 34 deletions
|
|
@ -43,7 +43,6 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:record/record.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
|
|
@ -784,7 +783,10 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
if (await Record().hasPermission() == false) return;
|
||||
// #Pangea
|
||||
// if (await Record().hasPermission() == false) return;
|
||||
// Pangea#
|
||||
|
||||
final result = await showDialog<RecordingResult>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:record/record.dart';
|
||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'events/audio_player.dart';
|
||||
|
||||
class RecordingDialog extends StatefulWidget {
|
||||
|
|
@ -28,7 +27,10 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
|
||||
bool error = false;
|
||||
String? _recordedPath;
|
||||
final _audioRecorder = Record();
|
||||
// #Pangea
|
||||
// final _audioRecorder = Record();
|
||||
final _audioRecorder = AudioRecorder();
|
||||
// Pangea#
|
||||
final List<double> amplitudeTimeline = [];
|
||||
|
||||
static const int bitRate = 64000;
|
||||
|
|
@ -53,13 +55,21 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
(await _audioRecorder.isEncoderSupported(AudioEncoder.opus))
|
||||
? AudioEncoder.opus
|
||||
: AudioEncoder.aacLc;
|
||||
|
||||
// #Pangea
|
||||
// await _audioRecorder.start(
|
||||
// path: _recordedPath,
|
||||
// bitRate: bitRate,
|
||||
// samplingRate: samplingRate,
|
||||
// );
|
||||
await _audioRecorder.start(
|
||||
encoder: audioCodec,
|
||||
path: _recordedPath,
|
||||
bitRate: bitRate,
|
||||
samplingRate: samplingRate,
|
||||
RecordConfig(
|
||||
encoder: audioCodec,
|
||||
bitRate: bitRate,
|
||||
// samplingRate: samplingRate,
|
||||
),
|
||||
path: _recordedPath!,
|
||||
);
|
||||
// Pangea#
|
||||
setState(() => _duration = Duration.zero);
|
||||
_recorderSubscription?.cancel();
|
||||
_recorderSubscription =
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import package_info_plus
|
|||
import pasteboard
|
||||
import path_provider_foundation
|
||||
import purchases_flutter
|
||||
import record_macos
|
||||
import record_darwin
|
||||
import sentry_flutter
|
||||
import share_plus
|
||||
import shared_preferences_foundation
|
||||
|
|
@ -68,7 +68,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
PurchasesFlutterPlugin.register(with: registry.registrar(forPlugin: "PurchasesFlutterPlugin"))
|
||||
RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin"))
|
||||
RecordPlugin.register(with: registry.registrar(forPlugin: "RecordPlugin"))
|
||||
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
|
||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
|
|
|
|||
44
pubspec.lock
44
pubspec.lock
|
|
@ -1792,50 +1792,58 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: record
|
||||
sha256: f703397f5a60d9b2b655b3acc94ba079b2d9a67dc0725bdb90ef2fee2441ebf7
|
||||
sha256: "5c8e12c692a4800b33f5f8b6c821ea083b12bfdbd031b36ba9322c40a4eeecc9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.4.4"
|
||||
version: "5.0.4"
|
||||
record_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_android
|
||||
sha256: "805ecaa232a671aff2ee9ec4730ef6addb97c548d2db6b1fbd5197f1d4f47a5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
record_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_darwin
|
||||
sha256: ee8cb1bb1712d7ce38140ecabe70e5c286c02f05296d66043bee865ace7eb1b9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
record_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_linux
|
||||
sha256: "348db92c4ec1b67b1b85d791381c8c99d7c6908de141e7c9edc20dad399b15ce"
|
||||
sha256: "7d0e70cd51635128fe9d37d89bafd6011d7cbba9af8dc323079ae60f23546aef"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
record_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_macos
|
||||
sha256: d1d0199d1395f05e218207e8cacd03eb9dc9e256ddfe2cfcbbb90e8edea06057
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
version: "0.7.1"
|
||||
record_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_platform_interface
|
||||
sha256: "7a2d4ce7ac3752505157e416e4e0d666a54b1d5d8601701b7e7e5e30bec181b4"
|
||||
sha256: "3a4b56e94ecd2a0b2b43eb1fa6f94c5b8484334f5d38ef43959c4bf97fb374cf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "1.0.2"
|
||||
record_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_web
|
||||
sha256: "219ffb4ca59b4338117857db56d3ffadbde3169bcaf1136f5f4d4656f4a2372d"
|
||||
sha256: "24847cdbcf999f7a5762170792f622ac844858766becd0f2370ec8ae22f7526e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "1.0.5"
|
||||
record_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_windows
|
||||
sha256: "42d545155a26b20d74f5107648dbb3382dbbc84dc3f1adc767040359e57a1345"
|
||||
sha256: "39998b3ea7d8d28b04159d82220e6e5e32a7c357c6fb2794f5736beea272f6c3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.1"
|
||||
version: "1.0.2"
|
||||
remove_emoji:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -77,7 +77,10 @@ dependencies:
|
|||
qr_code_scanner: ^1.0.0
|
||||
qr_flutter: ^4.0.0
|
||||
receive_sharing_intent: ^1.4.5
|
||||
record: 4.4.4 # Upgrade to 5 currently breaks playing on iOS
|
||||
# #Pangea
|
||||
# record: 4.4.4 # Upgrade to 5 currently breaks playing on iOS
|
||||
record: ^5.0.4
|
||||
# Pangea#
|
||||
scroll_to_index: ^3.0.1
|
||||
share_plus: ^7.2.1
|
||||
shared_preferences: ^2.2.0 # Pinned because https://github.com/flutter/flutter/issues/118401
|
||||
|
|
@ -149,8 +152,8 @@ flutter:
|
|||
# #Pangea
|
||||
# uncomment this to enable mobile builds
|
||||
# causes error with github actions
|
||||
# - .env
|
||||
# - assets/.env
|
||||
- .env
|
||||
- assets/.env
|
||||
- assets/pangea/
|
||||
- assets/pangea/bot_faces/
|
||||
# Pangea#
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue