id3tag 0.1.0 copy "id3tag: ^0.1.0" to clipboard
id3tag: ^0.1.0 copied to clipboard

A cross-platform, pure-Dart package for reading ID3 meta data

ID3Tag #

ID3Tag is a small library for reading common ID3 meta data from mp3-files and other types of media files. There are of course already other libraries for doing this out there, but at the time of creating this library, none of them provided support in three critical areas:

  • Reading chapter (CHAP) frames
  • Reading ID3 meta data without having to load the entire file into memory
  • Easy extensibility to be able to implement support for additional frame types

Thus, the above list was the basic motivation for creating this library. Also, the specific use case of supporting mp3 audio books was another motivating factor (hence support for chapters and large file sizes).

Features #

  • Support for ID3 v2.3 (and above)
  • Support for common ID3 frames, such as:

Usage #

To use this package, simply include the dependency, import the package and then use the class ID3TagReader to read the ID3 tag from a file.

final parser = ID3TagReader.path('path to a file');
final tag = parser.readTagSync();
print('Title: ${tag.title}');
print('Chapters: ${tag.chapters}');

During development, it may sometimes be convenient to use files in the form of asset resources. To accomplish this, you can use the snippet below (requires the path_provider package):

import 'package:path_provider/path_provider.dart';
...
final ByteData fileData = await rootBundle.load('some asset file');
final filePath = '${(await getTemporaryDirectory()).path}/a file name';
File(filePath).writeAsBytesSync(fileData.buffer.asUint8List(fileData.offsetInBytes, fileData.lengthInBytes));

On the horizon #

The plan is to add support for reading the table of contents (CTOC) frame type.

Additional information #

This library was initially derived from the package id3, but later refactored, rewritten and and rearchitected for better extensibility, readability and robustness. The architecture was in part inspired by OutcastID3.

11
likes
110
pub points
73%
popularity

Publisher

verified publisherleafnode.se

A cross-platform, pure-Dart package for reading ID3 meta data

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on id3tag