{"id":25412264,"url":"https://github.com/samurai016/audiotagger","last_synced_at":"2025-04-09T19:20:19.362Z","repository":{"id":54132470,"uuid":"210000648","full_name":"Samurai016/Audiotagger","owner":"Samurai016","description":"This library allow you to read and write ID3 tags to MP3 files.","archived":false,"fork":false,"pushed_at":"2024-12-20T08:53:08.000Z","size":887,"stargazers_count":24,"open_issues_count":5,"forks_count":25,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T13:06:49.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/audiotagger","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samurai016.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-21T14:36:55.000Z","updated_at":"2025-01-15T01:45:03.000Z","dependencies_parsed_at":"2025-02-16T11:18:48.441Z","dependency_job_id":"c81eaabf-41a0-466b-b88c-b5e2aa6ec66d","html_url":"https://github.com/Samurai016/Audiotagger","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samurai016%2FAudiotagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samurai016%2FAudiotagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samurai016%2FAudiotagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samurai016%2FAudiotagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samurai016","download_url":"https://codeload.github.com/Samurai016/Audiotagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094991,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-16T11:18:30.182Z","updated_at":"2025-04-09T19:20:19.322Z","avatar_url":"https://github.com/Samurai016.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# audiotagger\n![build status](https://img.shields.io/badge/build-passing-brightgreen?style=flat-square)\n[![pub](https://img.shields.io/pub/v/audiotagger?style=flat-square)](https://pub.dev/packages/audiotagger)\n\nThis library allow you to read and write ID3 tags to MP3 files.  \\\nBased on **JAudiotagger** library.\n\n\u003e **Library actually works only on Android.**\n\n## Add dependency\n```yaml\ndependencies:\n  audiotagger: ^2.2.1\n```\nAudiotagger need access to read and write storage.  \\\nTo do this you can use [Permission Handler library](https://pub.dev/packages/permission_handler).\n\n## Table of contents\n- [Basic usage](#basic-usage)\n- [Reading operations](#reading-operations)\n    - [Read tags as `Tag` object](#read-tags-as-tag-object)\n    - [Read tags as map](#read-tags-as-map)\n    - [Read artwork](#read-artwork)\n    - [Read audio file as `AudioFile` object](#read-audio-file-as-audiofile-object)\n    - [Read audio file as map](#read-audio-file-as-map)\n- [Writing operations](#writing-operations)\n    - [Write tags from map](#write-tags-from-map)\n    - [Write tags from `Tag` object](#write-tags-from-tag-object)\n    - [Write single tag field](#write-single-tag-field)\n- [Models](#models)\n    - [`Tag` class](#tag-class)\n        - [`Map` of `Tag`](#map-of-tag)\n    - [`AudioFile` class](#audiofile-class)\n        - [`Map` of `AudioFile`](#map-of-audiofile)\n\n\n## Basic usage\nInitialize a new instance of the tagger;\n```dart\nfinal tagger = new Audiotagger();\n```\n\n## Reading operations\n\n### Read tags as `Tag` object\nObtain ID3 tags of the file as a `Tag` object.\n```dart\nvoid getTags() async {\n    final String filePath = \"/storage/emulated/0/file.mp3\";\n    final Tag tag = await tagger.readTags(\n        path: filePath\n    );\n}\n```\n\n[**This method does not read the artwork of the song. To do this, use the `readArtwork` method.**](#read-artwork)\n\nThe `Tag` object has this schema: [`Tag` schema](#tag-class).\n\n### Read tags as map\nObtain ID3 tags of the file as a `Map`.\n```dart\nvoid getTagsAsMap() async {\n    final String filePath = \"/storage/emulated/0/file.mp3\";\n    final Map map = await tagger.readTagsAsMap(\n        path: filePath\n    );\n}\n```\n[**This method does not read the artwork of the song. To do this, use the `readArtwork` method.**](#read-artwork)\n\nThe map has this schema: [`Map` of `Tag` schema](#map-of-tag).\n\n### Read artwork\nObtain the artwork of the song as a `Uint8List`.\n```dart\nvoid getArtwork() async {\n    final String filePath = \"/storage/emulated/0/file.mp3\";\n    final Uint8List bytes = await tagger.readArtwork(\n        path: filePath\n    );\n}\n```\n\n### Read audio file as `AudioFile` object\nObtain informations about the MP3 file as a `Tag` object.\n```dart\nvoid getAudioFile() async {\n    final String filePath = \"/storage/emulated/0/file.mp3\";\n    final AudioFile audioFile = await tagger.readAudioFile(\n        path: filePath\n    );\n}\n```\n\nThe `AudioFile` object has this schema: [`AudioFile` schema](#audiofile-class).\n\n### Read audio file as map\nObtain informations about the MP3 file as a `Map`.\n```dart\nvoid getAudioFileAsMap() async {\n    final String filePath = \"/storage/emulated/0/file.mp3\";\n    final Map map = await tagger.readAudioFileAsMap(\n        path: filePath\n    );\n}\n```\n\nThe map has this schema: [`Map` of `AudioFile` schema](#map-of-audiofile).\n\n## Writing operations\n\n### Write tags from map\nYou can write the ID3 tags from a `Map`.  \\\nTo reset a field, pass an empty string (`\"\"`).  \\\nIf the value is `null`, the field will be ignored and it will not be written.\n\n```dart\nvoid setTagsFromMap() async {\n    final path = \"storage/emulated/0/Music/test.mp3\";\n    final tags = \u003cString, String\u003e{\n        \"title\": \"Title of the song\",\n        \"artist\": \"A fake artist\",\n        \"album\": \"\",    //This field will be reset\n        \"genre\": null,  //This field will not be written\n    };\n\n    final result = await tagger.writeTagsFromMap(\n        path: path,\n        tags: tags\n    );\n}\n```\n\nThe map has this schema: [`Map` of `Tag` schema](#map-of-tag).\n\n### Write tags from `Tag` object\nYou can write the ID3 tags from a `Tag` object.  \\\nTo reset a field, pass an empty string (`\"\"`).  \\\nIf the value is `null`, the field will be ignored and it will not be written.\n\n```dart\nvoid setTags() async {\n    final path = \"storage/emulated/0/Music/test.mp3\";\n    final tag = Tag(\n        title: \"Title of the song\",\n        artist: \"A fake artist\",\n        album: \"\",    //This field will be reset\n        genre: null,  //This field will not be written\n    );\n\n    final result = await tagger.writeTags(\n        path: path,\n        tag: tag,\n    );\n}\n```\n\nThe `Tag` object has this schema: [`Tag` schema](#tag-class).\n\n### Write single tag field\nYou can write a single tag field by specifying the field name.  \\\nTo reset the field, pass an empty string (`\"\"`).  \\\nIf the value is `null`, the field will be ignored and it will not be written.  \\\n\n```dart\nvoid setTags() async {\n    final path = \"storage/emulated/0/Music/test.mp3\";\n\n    final result = await tagger.writeTag(\n        path: path,\n        tagField: \"title\",\n        value: \"Title of the song\"\n    );\n}\n```\n\nRefer to [`Map` of `Tag` schema](#map-of-tag) for fields name.\n\n## Models\n\nThese are the schemes of the `Map` and classes asked and returned by Audiotagger.\n\n### `Tag` class\n```dart\nString? title;\nString? artist;\nString? genre;\nString? trackNumber;\nString? trackTotal;\nString? discNumber;\nString? discTotal;\nString? lyrics;\nString? comment;\nString? album;\nString? albumArtist;\nString? year;\nString? artwork; // It represents the file path of the song artwork.\n```\n\n### `Map` of `Tag`\n```dart\n\u003cString, String\u003e{\n    \"title\": value,\n    \"artist\": value,\n    \"genre\": value,\n    \"trackNumber\": value,\n    \"trackTotal\": value,\n    \"discNumber\": value,\n    \"discTotal\": value,\n    \"lyrics\": value,\n    \"comment\": value,\n    \"album\": value,\n    \"albumArtist\": value,\n    \"year\": value,\n    \"artwork\": value, // Null if obtained from readTags or readTagsAsMap\n};\n```\n\n### `AudioFile` class\n```dart\nint? length;\nint? bitRate;\nString? channels;\nString? encodingType;\nString? format;\nint? sampleRate;\nbool? isVariableBitRate;\n```\n\n### `Map` of `AudioFile`\n```dart\n\u003cString, dynamic?\u003e{\n    \"length\": length,\n    \"bitRate\": bitRate,\n    \"channels\": channels,\n    \"encodingType\": encodingType,\n    \"format\": format,\n    \"sampleRate\": sampleRate,\n    \"isVariableBitRate\": isVariableBitRate,\n};\n```\n\n## Copyright and license\nThis library is developed and maintained by Nicolò Rebaioli  \n:globe_with_meridians: [My website](https://rebaioli.altervista.org)  \n:mailbox: [niko.reba@gmail.com](mailto:niko.reba@gmail.com)\n\nReleased under [MIT license](LICENSE)\n\nCopyright 2021 Nicolò Rebaioli","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamurai016%2Faudiotagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamurai016%2Faudiotagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamurai016%2Faudiotagger/lists"}