question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]:PlatformException (PlatformException(Audio Player, startPlayer failure, null, null))

See original GitHub issue

Flutter 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:

  1. Go to β€˜β€¦β€™
  2. Click on β€˜β€¦β€™
  3. Scroll down to β€˜β€¦β€™
  4. 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:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
isiyemijoecommented, Apr 26, 2022

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;

0reactions
zhou-candycommented, Apr 21, 2022

ζˆ‘ηŸ₯ι“ζ€ŽδΉˆθ§£ε†³δΊ†οΌŒιœ€θ¦εˆε§‹εŒ–AudioSession。

Read more comments on GitHub >

github_iconTop Results From Across the Web

PlatformException when calling startPlayerFromTrack method
I expect track player to initialize MediaController and start playing music after calling startPlayerFromTrack method.
Read more >
flutter_sound 8.4.2 startPlayer() exception - Stack Overflow
It's played Now I was missing that the file extension is aac not acc. so it should be await _audioPlayer!.startPlayer( fromURI:Β ...
Read more >
just_audio | Flutter Package - Pub.dev
A feature-rich audio player for Flutter. Loop, clip and concatenate any sound from any source (asset/file/URL/stream) in a variety of audio formats withΒ ......
Read more >
Flutter Sound Plugin (Audio Recorder & Player) - Medium
What this module can do for ease of development. Supports playing audio in background. Able to grab the actual uri of audio file...
Read more >
PlatformException(Audio Player, startPlayer failure, null, null ...
Canardoux/flutter_sound: ui_dart_state.cc(199)] Unhandled Exception: PlatformException(Audio Player, startPlayer failure, null, null)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found