Musynth’s tag editor lets you fix or update the embedded metadata of any local audio file without leaving the app. Changes are written directly to the file using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CesarArellano/Music-Player-App/llms.txt
Use this file to discover all available pages before exploring further.
music_query_selector plugin’s native JAudioTagger implementation. This page explains how to access the editor, what fields are available, and the read/write flow including permission handling.
Accessing the tag editor
Long-press a song
Long-press any song tile — in the Songs tab, an album screen, an artist screen, the Favourites tab, search results, or the playing queue — to open
MoreSongOptionsModal.Tap 'Edit tags'
The context menu lists an Edit tags option that navigates to the tag editor screen, passing the song’s file path.
Make changes
Edit any combination of text fields and optionally pick a new artwork image from the gallery.
TagData fields
TagEditorService works with a TagData value object. Every text field maps directly to a standard ID3 frame:
| Field | Type | ID3 equivalent |
|---|---|---|
title | String | TIT2 |
album | String | TALB |
artist | String | TPE1 |
composer | String | TCOM |
genre | String | TCON |
year | String | TDRC / TYER |
track | String | TRCK |
artworkBytes | Uint8List? | APIC (optional) |
Reading tags
CallTagEditorService.readTags(path) with the absolute file path of the audio file. The method delegates to MusicQuerySelector.readTags, which invokes JAudioTagger on the native side and returns a Map<String, dynamic>. The service maps each key to the corresponding TagData field, defaulting to an empty string for any missing field:
Writing tags
Permission check
Before writing, callTagEditorService.ensureWritePermission(). On Android 11 and above, writing arbitrary audio files requires the MANAGE_EXTERNAL_STORAGE (“All files access”) permission. The method:
- Checks if the permission is already granted — returns
trueimmediately if so. - Calls
Permission.manageExternalStorage.request(), which navigates the user to the system All files access screen. - Returns
trueif granted,falseif denied.
Writing the tags
Once permission is confirmed, callTagEditorService.writeTags(path, data):
artworkBytes is omitted from the map when null, signalling to the native layer that the existing artwork should be left untouched.
Full write flow
Updating artwork
To change a track’s embedded artwork:- Use the
image_pickerpackage to let the user select an image from the gallery. - Read the file as bytes (
File.readAsBytes()). - Pass the bytes as
TagData.artworkBytes. - Call
writeTags— JAudioTagger embeds the bytes as anAPICframe.
artworkBytes is non-null, pass forceCreatingArtworks: true to getAllSongs() after saving so Musynth regenerates the cached .jpg thumbnail used throughout the app.
Refreshing the library after edits
After a successful tag write, call
LibraryCubit.getAllSongs(forceCreatingArtworks: true) to reload the song list from MediaStore (which now reflects the updated tags) and regenerate the in-app artwork cache. Without this step, the old metadata and artwork will continue to display until the next cold start.forceCreatingArtworks flag bypasses the “already ran once” guard in the artwork cache service, ensuring that even unchanged artwork is re-extracted so the cache stays consistent.