I'm trying to play an mp3 I will bundle with my app. I added it in the assets, just like the images, added to the pubspec, but can't make it play.
I tried two libraries, rxlabz/audioplayer and evrone/flutter_audio (medrecorder_audio), to no avail.
The first I tryed configuring to isLocal: true, added every conceivable callback, but it just returned the error:
Attempt to call getDuration without a valid mediaplayer
Which I couldn't relate to flutter/dart but found is a common error on Android, related to not calling prepare method. I checked their code, though, and they seem to be calling. I thought it my be async, so I waited a while after creating the player to call start, no luck.
The latter just gives the error "startPlay: FAIL" when I start play.
It seems these libs are made to play an audio that's on the user's cellphone, but I'm not sure. I want to play my own custom mp3 that I will bundle as an asset. Would someone shed some light?