mirror of
https://github.com/Iconica-Development/flutter_media_picker.git
synced 2025-05-19 00:43:45 +02:00
fix: debug logs
removed logs on initialisation of audioService
This commit is contained in:
parent
98eb5330ac
commit
6d8912c581
1 changed files with 10 additions and 6 deletions
|
@ -12,12 +12,9 @@ import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
class MediaPickerAudioService implements AudioService {
|
class MediaPickerAudioService implements AudioService {
|
||||||
final FlutterSoundRecorder _recorder = FlutterSoundRecorder(
|
late FlutterSoundRecorder _recorder;
|
||||||
logLevel: Level.debug,
|
late FlutterSoundPlayer _player;
|
||||||
);
|
|
||||||
final FlutterSoundPlayer _player = FlutterSoundPlayer(
|
|
||||||
logLevel: Level.nothing,
|
|
||||||
);
|
|
||||||
Directory? _directory;
|
Directory? _directory;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -37,6 +34,10 @@ class MediaPickerAudioService implements AudioService {
|
||||||
throw RecordingPermissionException('Microphone permission not granted');
|
throw RecordingPermissionException('Microphone permission not granted');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_recorder = FlutterSoundRecorder(
|
||||||
|
logLevel: Level.debug,
|
||||||
|
);
|
||||||
|
|
||||||
_recorder.openRecorder();
|
_recorder.openRecorder();
|
||||||
if (_recorder.isRecording) {
|
if (_recorder.isRecording) {
|
||||||
await _recorder.resumeRecorder();
|
await _recorder.resumeRecorder();
|
||||||
|
@ -56,6 +57,9 @@ class MediaPickerAudioService implements AudioService {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void playAudio(Uint8List audio) {
|
void playAudio(Uint8List audio) {
|
||||||
|
_player = FlutterSoundPlayer(
|
||||||
|
logLevel: Level.debug,
|
||||||
|
);
|
||||||
_recorder.closeRecorder();
|
_recorder.closeRecorder();
|
||||||
_player.openPlayer();
|
_player.openPlayer();
|
||||||
_player.startPlayer(
|
_player.startPlayer(
|
||||||
|
|
Loading…
Reference in a new issue