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(Audio Player, startPlayer failure, null, null)

See original GitHub issue

Flutter Sound Version :

FULL

  • Important: Result of the command : flutter pub deps | grep flutter_sound
|-- flutter_sound 8.1.9
|   |-- flutter_sound_platform_interface 8.1.9
|   |-- flutter_sound_web 8.1.9
|   |   |-- flutter_sound_platform_interface...

Severity

  • Crash ?

  • Result is not what expected ? Play the recording from files

  • Cannot build my App ?

  • Minor issue ?

  • Major Issue


Platforms you faced the error

I’ve only tried it on iOS Real device


Describe the bug A clear and concise description of what the bug is.

I use a file picker to pick the file from my phone. The test recording I am using is found in my phones downloads

I then run something along these lines

await audioPlayer.openAudioSession(
        focus: AudioFocus.requestFocusAndDuckOthers,     
);
audioPlayer.startPlayer(
      fromURI: audioUrl,   
)

And it shows the platform exception

I use this package to pick the file

file_picker: ^3.0.3

The path to the file I am play is this private/var/mobile/Containers/Data/Application/SOME-RANDOM-CODE/tmp/com.my.app-Inbox/my - recording.mp3

I also check that the file exists before playing it, it exists


Logs!!!

(This is very important. Most of the time we cannot do anything if we do not have information on your bug)

[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: PlatformException(Audio Player, startPlayer failure, null, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
<asynchronous suspension>
#2      MethodChannelFlutterSoundPlayer.invokeMethod (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:184:12)
<asynchronous suspension>
#3      FlutterSoundPlayer._startPlayer (package:flutter_sound/public/flutter_sound_player.dart:1118:19)
<asynchronous suspension>
#4      FlutterSoundPlayer.startPlayer.<anonymous closure> (package:flutter_sound/public/flutter_sound_player.dart:1048:11)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
MATTYGILOcommented, Jul 14, 2021

Ok I just got it to work, no worries it isn’t a problem with Flutter sound

1reaction
mickey-ichicommented, Jul 22, 2021

I fixed it by using fromDataBuffer instead of fromURI

Read more comments on GitHub >

github_iconTop Results From Across the Web

PlatformException when calling startPlayerFromTrack method
Unhandled Exception: PlatformException(error, Attempt to invoke virtual method ... getTransportControls()' on a null object reference, null).
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 >
[Solved]-flutter_sound 8.4.2 startPlayer() exception-Flutter
to play audios i use this library audioplayers: ^0.19.1 declare this variable to access audio. String audioCorrect = "audio/access_granted.mp3"; ...
Read more >
Flutter Sound Plugin (Audio Recorder & Player) - Medium
Start player. String path = await flutterSound.startPlayer(null); _playerSubscription = flutterSound.onPlayerStateChanged.listen((e) { if (e != null) {
Read more >
Issues · Canardoux/flutter_sound · GitHub
[BUG]: Player setSpeed not working in some versions of Android and iOS maybe ... PlatformException(Audio Player, startPlayer failure, null, null) maybe bug ......
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