Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

Flutter plugin to read metadata of MP3 media files

A simple Flutter plugin for reading  metadata of  media files.

 Usage

import 'package:media_metadata_retriever/media_metadata_retriever.dart';

Future<void> getMetadata() async {
    final metadataRetriever = new MediaMetadataRetriever();
    /* Set File path */
    await metadataRetriever.setFile(new File('/storage/emulated/0/Music/music.aac'));
    /* Access metadata */
    Metadata metadata = await metadataRetriever.metadata;
    print(metadata.trackName);
    print(metadata.trackArtistNames);
    print(metadata.albumName);
    print(metadata.albumArtistName);
    print(metadata.trackNumber);
    print(metadata.albumLength);
    print(metadata.year);
    print(metadata.genre);
    print(metadata.authorName);
    print(metadata.writerName);
    print(metadata.discNumber);
    print(metadata.mimeType);
    print(metadata.trackDuration);
    print(metadata.bitrate);
    /* Alternatively, you may convert it to a Map<String, dynamic> */
    metadata.toMap();
}

 Example

You may checkout example app for this plugin here.

Screenshot 1Screenshot 2

 Progress

PlatformStatus
AndroidWorking
LinuxComing Soon
WindowsNot Working

Download Metadata reader widget source code on GitHub

https://github.com/alexmercerind/media_metadata_retriever

Exit mobile version