[BUG]:PlatformException (PlatformException(Audio Player, startPlayer failure, null, null))
See original GitHub issueFlutter Sound Version : 9.1.9
-
FULL or LITE flavor ? Full
-
Important: Result of the command :
flutter pub deps | grep flutter_sound
Severity
-
Crash ? no
-
Result is not what expected ?yes
-
Cannot build my App ? no
-
Minor issue ? no
Platforms you faced the error
-
iOS ? yes iphone 8 plus ios 14
-
Android ? no
-
Flutter Web ?idk
-
Emulator ? no
-
Real device ? yes
Describe the bug Recorded audio doesnt play on real ios device with path /var/mobile/Containers/Data/Application/8E613239-E966-4244-B5AD-832263CBB5E6/Library/Caches/12345.aac
To Reproduce Steps to reproduce the behavior:
- Go to ββ¦β
- Click on ββ¦β
- Scroll down to ββ¦β
- See error
Logs!!!
(This is very important. Most of the time we cannot do anything if we do not have information on your bug).
To activate the logs, you must instantiate your modules with the Log Level set to Level.debug
:
FlutterSoundPlayer myPlayer = FlutterSoundPlayer(logLevel: Level.debug);
FlutterSoundRecorder myRecorder = FlutterSoundRecorder(logLevel: Level.debug);
See this
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: β π IOS:β> stopTimer flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: β #0 FlutterSoundPlayer.log package:flutter_sound/public/flutter_sound_player.dart:358 flutter: β #1 MethodChannelFlutterSoundPlayer.channelMethodCallHandler package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:137 flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: β π IOS:<-- stopTimer flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: β #0 FlutterSoundPlayer.log package:flutter_sound/public/flutter_sound_player.dart:358 flutter: β #1 MethodChannelFlutterSoundPlayer.channelMethodCallHandler package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:137 flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ flutter: β π IOS:<-- startPlayer PlatformException (PlatformException(Audio Player, startPlayer failure, null, null))
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top GitHub Comments
For those who still have this issue, all you need to do is initialise the audio session before using this plugin like this
setupSession() async { final ses = await session; await ses.configure(AudioSessionConfiguration( avAudioSessionCategory: AVAudioSessionCategory.playAndRecord, avAudioSessionCategoryOptions: AVAudioSessionCategoryOptions.allowBluetooth | AVAudioSessionCategoryOptions.defaultToSpeaker, avAudioSessionMode: AVAudioSessionMode.spokenAudio, avAudioSessionRouteSharingPolicy: AVAudioSessionRouteSharingPolicy.defaultPolicy, avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none, androidAudioAttributes: const AndroidAudioAttributes( contentType: AndroidAudioContentType.speech, flags: AndroidAudioFlags.none, usage: AndroidAudioUsage.voiceCommunication, ), androidAudioFocusGainType: AndroidAudioFocusGainType.gain, androidWillPauseWhenDucked: true, )); }
final session = AudioSession.instance;
Make sure you call setupSession() before recording;
ζη₯ιζδΉθ§£ε³δΊοΌιθ¦εε§εAudioSessionγ