{"id":18463914,"url":"https://github.com/vimpunk/atag","last_synced_at":"2025-04-15T20:22:51.171Z","repository":{"id":117061795,"uuid":"112075845","full_name":"vimpunk/atag","owner":"vimpunk","description":":musical_score: Audio tag parsing for C++11 (header-only, supports ID3v1, ID3v2, FLAC, APE)","archived":false,"fork":false,"pushed_at":"2018-07-27T19:57:42.000Z","size":38,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T01:01:54.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vimpunk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-26T11:08:31.000Z","updated_at":"2024-12-21T10:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e64e8e8-fb7c-436a-aa1f-deccca1540f8","html_url":"https://github.com/vimpunk/atag","commit_stats":null,"previous_names":["vimpunk/atag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fatag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fatag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fatag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fatag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimpunk","download_url":"https://codeload.github.com/vimpunk/atag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249145962,"owners_count":21220066,"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":"2024-11-06T09:08:21.911Z","updated_at":"2025-04-15T20:22:51.139Z","avatar_url":"https://github.com/vimpunk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# atag\n\nAudio tag parsing C++ header-only library, supporting ID3v1, ID3v2, FLAC, APE and (at some point, maybe) others\n\n## Installation\n\natag consists purely of header files, so just place the contents of the `include` directory in your system-wide or your project's include folder.\n\n## Work in progress\n\nThis library is still a work-in-progress, but it will eventually support most other audio tag formats as well as full audio tag editing for all of them. So for now only tag parsing is supported for the above listed tag types.\n\n## Example\n\nThe following shows the basic usage:\n```\nif (atag::id3v2::is_tagged(source)) {\n    atag::id3v2::tag tag = atag::id3v2::parse(source);\n}\n```\nwhere `source` is some buffer type (`std::string`, `std::vector\u003cchar\u003e`, `std::array\u003cchar, N\u003e`, [`mio::mmap_source`](https://github.com/mandreyel/mio) or other).\nAll tag formats adhere to the above syntax, i.e.: `atag::{id3v1, id3v2, flac, ape}::{is_tagged, parse[, simple_parse]}`.\n\nA simple ID3v2 or FLAC parser (since these two are the most popular) program to show the basic usage of atag:\n\n```c++\n#include \u003catag.hpp\u003e\n\n#include \u003cfstream\u003e\n#include \u003csstream\u003e\n#include \u003ccstdio\u003e\n#include \u003ccstring\u003e\n\nint main(int argc, const char** argv)\n{\n    // Parse command line arguments.\n    if (argc \u003c 2) {\n        std::printf(\"usage: %s, \u003cpath-to-music-file\u003e [detailed]\\n\", argv[0]);\n        return -1;\n    }\n    bool detailed = false;\n    if (argc == 3 \u0026\u0026 std::strcmp(argv[2], \"detailed\") == 0) {\n        detailed = true;\n    }\n\n    // Read in the file.\n    const std::string source = [path = argv[1]] {\n        std::ifstream file(path);\n        if (!file) { throw std::runtime_error(std::string(\"could not open file \") + path); }\n        std::stringstream ss;\n        ss \u003c\u003c file.rdbuf();\n        return ss.str();\n    }();\n\n    using namespace atag;\n    if (id3v2::is_tagged(source)) {\n        std::printf(\"ID3v2 tag:\\n\");\n        if (detailed) {\n            // This will produce a lower level representation of the id3v2 tag.\n            id3v2::tag tag = id3v2::parse(source);\n            std::printf(\"tag:: version: %i, revision: %i, has_footer: %d, experimental: %d,\"\n                \" has extended header: %d, unsynchronized: %d, #frames: %lu\\n\",\n                tag.version, tag.revision, tag.flags \u0026 id3v2::tag::has_footer,\n                tag.flags \u0026 id3v2::tag::experimental, tag.flags \u0026 id3v2::tag::extended,\n                tag.flags \u0026 id3v2::tag::unsynchronisation, tag.frames.size());\n            for (const auto\u0026 frame : tag.frames) {\n                std::printf(\"%s : %s\\n\",\n                    id3v2::frame_id_to_hrstring(frame.id),\n                    frame.data.c_str());\n            }\n        } else {\n            // While this produces a simpler tag with only a few key fields, such as\n            // title, album, artist etc.\n            simple_tag tag = id3v2::simple_parse(source);\n            std::printf(\"title: %s\\nalbum: %s\\nartist: %s\\nyear: %i\\ntrack#: %i\\n\",\n                tag.title.c_str(), tag.album.c_str(), tag.artist.c_str(), tag.year,\n                tag.track_number);\n        }\n    } else if (flac::is_tagged(source)) {\n        std::printf(\"FLAC tag:\\n\");\n        flac::tag tag = flac::parse(source);\n        std::printf(\"title: %s\\nalbum: %s\\nartist: %s\\nyear: %i\\ntrack#: %i\\n\"\n            \"sample rate: %i Hz\\n#channels: %i\\n#samples: %i\\n\",\n            tag.title.c_str(), tag.album.c_str(), tag.artist.c_str(), tag.year,\n            tag.track_number, tag.sample_rate, tag.num_channels, tag.num_samples);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimpunk%2Fatag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimpunk%2Fatag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimpunk%2Fatag/lists"}