A Flutter plugin for reading and editing audio file metadata (ID3 tags) on Android. The plugin reads tag data from audio files and returns edited files as raw bytes (Uint8List), giving your app full control over where and how the resulting file is saved.
Platform Support
Platform
Supported
Android
Yes
iOS
No
Web
No
Desktop
No
Features
Read all metadata tags from an audio file, including artwork
Read metadata tags only (without artwork)
Read artwork only
Edit metadata tags (without touching artwork)
Edit artwork only
Edit metadata tags and artwork together in a single call
Returns the complete modified audio file as bytes (Uint8List) along with the file extension, so your app decides where to write it
Every editing method returns an AudioFileData object. The plugin does not write the file to disk. Your app receives the raw bytes and is responsible for saving them. Use dart:io to write the bytes to any path your app has access to.
import'dart:io';
// Edit tagsAudioFileData editedFile = await tagger.editTags(updatedTag, originalFilePath);
// Write the bytes to a fileString savePath = '/storage/emulated/0/Download/edited.${editedFile.fileExtension}';
File outputFile = File(savePath);
await outputFile.writeAsBytes(editedFile.musicData);
You can save to any writable location: the app's documents directory, the downloads folder, an external storage path, or overwrite the original file. The fileExtension field tells you the format of the audio data so you can construct the correct filename.
import'package:path_provider/path_provider.dart';
// Save to app documents directoryDirectory appDir = awaitgetApplicationDocumentsDirectory();
String fileName = 'my_song.${editedFile.fileExtension}';
File file = File('${appDir.path}/$fileName');
await file.writeAsBytes(editedFile.musicData);
// Or overwrite the original fileFile original = File(originalFilePath);
await original.writeAsBytes(editedFile.musicData);