hxid3

ID3 Tag Packer and Unpacker


Keywords
id3, metadata, mp3, id3-parser, id3v1, id3v2
License
GPL-2.0+
Install
haxelib install hxid3 1.0.0

Documentation

ID3 Tag API Library

Build Status

A library written in haxe, which allows user to create and access ID3 tag inner content. this library can create either ID3v1 or ID3v2 tags.

This library is a middleware between an mp3 tag editor software and bytes. MP3 tag editor should locate bytes of tag in mp3 and provied it to this library for ease of access to it's content.

Is this library for me?
If you have ID3 Tags read into haxe.io.Bytes or you can write haxe.io.Bytes directly into an mp3 file but don't know how to manipulate or create tags, this library is just for you.

Features

Abstract workspace is done yet this version is not complete, these are features:

Feature List

  • ID3v1 packer: packs ID3v1Tag object into tag bytes.
  • ID3v1 unpacker: unpacks bytes into ID3v1Tag object.
  • ID3v2 packer: packs ID3v2Tag object into tag bytes.
  • ID3v2 unpacker: unpacks bytes into ID3v2Tag object.
  • Access ID3v2 Frames: can access frames by asking their frame id.
  • Creating ID3v2 Frames: can create raw frames of bytes.
  • Adding ID3v2 Text Frames: can create text frames and unpacks them.

Not implemented yet

  • ID3v2 URL Frames: must not use text frames for url frames: WXX.
  • ID3v2 setting frame flags: currenly is not supported.
  • User defined frames: TXX and WXX frames currently override each other.
  • Attached picture frame: APIC frame is a bit tricky we must identify, picture type.
  • ID3v2 Other frames: non binary frames.

Examples

To read an mp3 file id3 version 1 tag:

var mp3content:Bytes = File.getBytes("path/to/mp3/file.mp3");
var id3v1header:Bytes = mp3content.sub(
    mp3content.length-ID3v1Tag.TAG_LENGTH, ID3v1Tag.TAG_LENGTH);

var id3:ID3v1Tag = new ID3v1Tag(id3v1header);

// Access
trace(id3.title);

For ID3v2 stay tuned, we need more api written.

Getting Started

This repository does not depend on any other library to feel free to:

$ haxelib install hxid3

Yet if you want to run tests it's required to install munit:

$ haxelib install munit