diff --git a/flutter_hbb/android/app/build.gradle b/flutter_hbb/android/app/build.gradle index b965b9517..efe0a7623 100644 --- a/flutter_hbb/android/app/build.gradle +++ b/flutter_hbb/android/app/build.gradle @@ -39,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.carriez.flutter_hbb" - minSdkVersion 18 + minSdkVersion 21 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/flutter_hbb/lib/model.dart b/flutter_hbb/lib/model.dart index a6facdcf1..f8e3dab49 100644 --- a/flutter_hbb/lib/model.dart +++ b/flutter_hbb/lib/model.dart @@ -1,7 +1,6 @@ import 'package:ffi/ffi.dart'; import 'package:flutter/gestures.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:flutter_sound/flutter_sound.dart'; import 'package:device_info/device_info.dart'; import 'dart:io'; import 'dart:math'; @@ -33,7 +32,6 @@ class FfiModel with ChangeNotifier { bool _waitForImage; bool _initialized = false; final _permissions = Map(); - final _audioPlayer = FlutterSoundPlayer(); get permissions => _permissions; get initialized => _initialized; @@ -66,13 +64,6 @@ class FfiModel with ChangeNotifier { _permissions.clear(); } - Future stopAudio() async { - final st = await _audioPlayer.getPlayerState(); - if (st != PlayerState.isPlaying) return; - await _audioPlayer.stopPlayer(); - await _audioPlayer.closeAudioSession(); - } - void update( String id, BuildContext context, @@ -97,23 +88,6 @@ class FfiModel with ChangeNotifier { pos = evt; } else if (name == 'permission') { FFI.ffiModel.updatePermission(evt); - } else if (name == "audio_format") { - () async { - try { - /* - var s = int.parse(evt['sample_rate']); - // var c = int.parse(evt['channels']); - // Flutter Sound does not support Floating Point PCM data, nor records with more that one audio channel. - // On Flutter Sound, Raw PCM is only PCM INT-Linerar 16 monophony - await stopAudio(); - await _audioPlayer.openAudioSession(); - await _audioPlayer.startPlayerFromStream( - codec: Codec.pcm16, numChannels: 1, sampleRate: s); - */ - } catch (e) { - print('audio_format: $e'); - } - }(); } } if (pos != null) FFI.cursorModel.updateCursorPosition(pos); @@ -139,21 +113,6 @@ class FfiModel with ChangeNotifier { }); } } - var frame = FFI._getAudio(); - if (frame != null && frame != nullptr) { - () async { - try { - /* - final ref = frame.ref; - final bytes = Uint8List.sublistView(ref.data.asTypedList(ref.len)); - await _audioPlayer.feedFromStream(bytes); - */ - } catch (e) { - print('play audio frame: $e'); - } - FFI._freeRgba(frame); - }(); - } } void handleSwitchDisplay(Map evt) { @@ -453,7 +412,6 @@ class FFI { static F3 _setByName; static F4 _freeRgba; static F5 _getRgba; - static F5 _getAudio; static Pointer _lastRgbaFrame; static var shift = false; static var ctrl = false; @@ -595,7 +553,6 @@ class FFI { _freeRgba = dylib .lookupFunction), F4>('free_rgba'); _getRgba = dylib.lookupFunction('get_rgba'); - _getAudio = dylib.lookupFunction('get_audio'); _dir = (await getApplicationDocumentsDirectory()).path; DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; diff --git a/flutter_hbb/pubspec.yaml b/flutter_hbb/pubspec.yaml index 89e034813..49b28d44f 100644 --- a/flutter_hbb/pubspec.yaml +++ b/flutter_hbb/pubspec.yaml @@ -34,7 +34,6 @@ dependencies: flutter_easyloading: ^2.1.3 tuple: ^1.0.1 wakelock: ^0.2.1+1 - flutter_sound: ^6.4.2+1 device_info: ^1.0.0 dev_dependencies: