#id3 #audio #parser #metadata

id3

A library for reading and writing ID3 metadata

19 releases

✓ Uses Rust 2018 edition

0.3.0 Feb 9, 2019
0.2.5 Aug 17, 2018
0.2.4 Jul 26, 2018
0.2.3 Dec 8, 2017
0.1.6 Jun 6, 2015

#3 in Audio

Download history 71/week @ 2018-12-20 22/week @ 2018-12-27 60/week @ 2019-01-03 42/week @ 2019-01-10 42/week @ 2019-01-17 21/week @ 2019-01-24 15/week @ 2019-01-31 30/week @ 2019-02-07 30/week @ 2019-02-14 36/week @ 2019-02-21 105/week @ 2019-02-28 26/week @ 2019-03-07 44/week @ 2019-03-14 530/week @ 2019-03-21 56/week @ 2019-03-28

338 downloads per month
Used in 5 crates

MIT license

171KB
4K SLoC

rust-id3

Build Status Docs

A library for reading and writing ID3 metadata.

Usage

fn main() {
  let tag = id3::Tag::read_from_path("testdata/id3v24.id3").unwrap();

  // print the artist the hard way
  println!("{}", tag.get("TPE1").unwrap().content().text().unwrap());

  // or print it the easy way
  println!("{}", tag.artist().unwrap());
}

Supported ID3 Versions

  • ID3v1 reading
  • ID3v2.2 reading/writing
  • ID3v2.3 reading/writing
  • ID3v2.4 reading/writing

Unsupported Features

  • Grouping identity
  • Encryption

Contributors


lib.rs:

A library to read and write ID3v2 tags. ID3 versions v2.2, v2.3, and v2.4 are supported.

Modifying an existing tag

use id3::{Tag, Version};

let mut tag = Tag::read_from_path("music.mp3").unwrap();

// print the artist the hard way
println!("{}", tag.get("TPE1").unwrap().content().text().unwrap());

// or print it the easy way
println!("{}", tag.artist().unwrap());

tag.write_to_path("music.mp3", Version::Id3v24).unwrap();

Creating a new tag

use id3::{Tag, Frame, Version};
use id3::frame::Content;

let mut tag = Tag::new();

// set the album the hard way
let frame = Frame::with_content("TALB", Content::Text("album".to_string()));
tag.add_frame(frame);

// or set it the easy way
tag.set_album("album");

tag.write_to_path("music.mp3", Version::Id3v24).unwrap();

Resources

Dependencies

~6MB
~108K SLoC