3

I have path of the audio file like "sdcard://music/ABC.mp3" . How to get other details such as album, artist, duration etc from that path.

Aman gautam
  • 822
  • 2
  • 9
  • 20

2 Answers2

0

If you are using flutter_sound, there are utility methods which can give you the duration in milliseconds and some other metadata. From the package docs:

int duration = await flutterSoundHelper.duration( this._path[_codec.index] );
Map<dynamic, dynamic> info = await flutterSoundHelper.FFmpegGetMediaInformation( uri );
TM00
  • 1,330
  • 1
  • 14
  • 26
-1

You can use fluter_music_player plugin to play, pause, album artist, duration etc. It's support both ios and android.

See Flutter Music Player this sample Music player flutter project using this plugin

Magesh Pandian
  • 8,789
  • 12
  • 45
  • 60
  • The project itself says 'This project is not implemented for ios yet.So wait for it or if you can contribute then please do help.' Careful when trying for IOS. – Henok Mar 12 '20 at 18:12