on_audio_edit 1.0.2 on_audio_edit: ^1.0.2 copied to clipboard
Flutter Plugin used to edit and read audios/songs infos/tags [Mp3, OggVorbis, Wav, etc...].
on_audio_edit #
on_audio_edit
is a Flutter Plugin used to edit and read audios/songs 🎶 infos/tags [Mp3, OggVorbis, Wav, etc...].
This Plugin use AdrienPoupa:jaudiotagger as dependency to edit audios tags.
Help: #
Any problem? Issues
Any suggestion? Pull request
Translations: #
NOTE: Feel free to help with readme translations
Topics: #
How to Install: #
Add the following code to your pubspec.yaml
:
dependencies:
on_audio_edit: ^1.0.2
Request Permission:
You will need add the following code to your AndroidManifest.xml
Note: This Plugin don't have a built-in request permission
<manifest> ...
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>
Legacy External Storage:
If you are using/want to use Android 10
will need add the following code to your AndroidManifest.xml
<application> ...
android:requestLegacyExternalStorage="true"
</application>
Some Features: #
- Read Audios/Songs tags.
- Edit Audios/Songs tags.
- Supports Android 10 and above.
TODO: #
- Add better performance for all plugin.
- Add
[deleteArtwork]
to Android 10 and above. - Add
[deleteArtworks]
to Android 10 and above. - Add
[deleteAudio]
to Android 10 and above. - Fix bugs.
How to use: #
OnAudioEdit() // The main method to start using the plugin.
All types of methods on this plugin:
Methods | Parameters | Return |
---|---|---|
readAudio |
(String) |
Map<dynamic, dynamic> |
readAllAudio |
(String) |
Map<TagsType, dynamic> |
readAudios |
(List<String>) |
List<AudiosTagModel> |
readSingleAudioTag |
(String, TagsType) |
String |
readSpecificsAudioTags |
(String, List<TagsType>) |
Map<dynamic, dynamic> |
editAudio |
(String, Map<TagsType, dynamic>) |
bool |
editAudios |
(List<String>, List<Map<TagsType, dynamic>>) |
bool |
editArtwork |
(String, bool, String, ArtworkFormat, int, String) |
bool |
deleteArtwork |
[W](String) |
bool |
deleteArtworks |
[W](List<String>) |
bool |
deleteAudio |
[W](String) |
bool |
getImagePath |
String |
|
permissionsStatus |
bool |
|
resetComplexPermission |
[Q] | bool |
requestComplexPermission |
[Q] | bool |
requestComplexPermission |
[Q] | bool |
[Q] -> Only necessary on Android 10 or above.
[W] -> These methods are currently only implemented on Android 9 or below.
TagsType: #
Types | Types | Types | Types | Types |
---|---|---|---|---|
ALBUM_ARTIST |
ORIGINAL_ARTIST |
ORIGINAL_ALBUM |
TRACK |
FORMAT |
ARTIST |
ORIGINAL_LYRICIST |
LYRICS |
TITLE |
SAMPLE_RATE |
ARTISTS |
ORIGINAL_YEAR |
LANGUAGE |
TEMPO |
CHANNELS |
BEATS_PER_MINUTE |
PRODUCER |
KEY |
TAGS |
COVER_ART |
COMPOSER |
QUALITY |
ISRC |
SUBTITLE |
TYPE |
COUNTRY |
RATING |
FIRST_ARTWORK |
LENGTH |
|
GENRE |
RECORD_LABEL |
YEAR |
BITRATE |
Using readAllAudio you can get more infos about audio. See all list in: AllTags
Examples: #
readAudio
// data: "/storage/1E65-6GH3/SomeMusic.mp3" or "/storage/someFolder/SomeMusic.mp3"
Map<dynamic, dynamic> song = await OnAudioEdit().readAudio(data);
var songTitle = song["TITLE"];
var songArtist = song["ARTIST"];
readAllAudio
This method read all possible info from a audio. See all list in: AllTags
Map<dynamic, dynamic> song = await OnAudioEdit().readAllAudio(data);
var songInfo1 = song["MIXER"];
var songInfo2 = song["MUSICBRAINZ_ORIGINAL_RELEASE_ID"];
var songInfo3 = song["AMAZON_ID"];
var songInfo4 = song["CONDUCTOR"];
readAudios
List<String> allData = [data0, data1, data2];
List<AudiosTagModel> song = await OnAudioEdit().readAudios(allData);
...
var songTitle1 = song[1].title;
var songTitle2 = song[2].title;
var songTitle3 = song[3].title;
readSingleAudioTag
String title = await OnAudioEdit().readSingleAudioTag(data, TagsType.TITLE);
print(title); // Ex: Heavy, California
...
String artist = await OnAudioEdit().readSingleAudioTag(data, TagsType.ARTIST);
print(artist); // Ex: Jungle
readSpecificsAudioTags
List<TagsType> tags = [
TagsType.TITLE,
TagsType.ARTIST
];
var songSpecifics = await OnAudioEdit().readSpecificsAudioTags(data, tags);
...
var songTitle = songSpecifics["TITLE"];
var songArtist = songSpecifics["ARTIST"];
editAudio
Map<TagsType, dynamic> tags = {
TagsType.TITLE: "New Title",
TagsType.ARTIST: "New Artist"
};
bool song = await OnAudioEdit().editAudio(data, tags);
print(song); //True or False
editAudios
⚠ Note: This method isn't implemented on Android 10 or above. Instead use: editAudio
// Tags
List<<Map<TagsType, dynamic>> tags = [];
Map<TagsType, dynamic> getTags = {
TagsType.TITLE: "New Title",
TagsType.ARTIST: "New Artist"
};
tags.add(getTags);
// Songs data
List<String> data;
data.add(song1);
data.add(song2);
data.add(song3);
bool result = await OnAudioEdit().editAudios(data, tags);
print(result); //True or False
editAudio
⚠ Note: If openFilePicker is false, imagePath can't be null.
// Parameters: openFilePicker, imagePath, format, size, description
// DEFAULT: true, null, ArtworkFormat.JPEG, 24, "artwork"
bool song = await OnAudioEdit().editArtwork(data);
print(song); //True or False