#id3 #audio #parser #metadata

id3

A library for reading and writing ID3 metadata

22 releases

0.5.1 May 1, 2020
0.5.0 Feb 2, 2020
0.4.0 Jan 29, 2020
0.3.0 Feb 9, 2019
0.1.6 Jun 6, 2015

#7 in Audio

Download history 252/week @ 2020-08-07 250/week @ 2020-08-14 302/week @ 2020-08-21 322/week @ 2020-08-28 344/week @ 2020-09-04 191/week @ 2020-09-11 282/week @ 2020-09-18 470/week @ 2020-09-25 220/week @ 2020-10-02 260/week @ 2020-10-09 236/week @ 2020-10-16 206/week @ 2020-10-23 391/week @ 2020-10-30 689/week @ 2020-11-06 300/week @ 2020-11-13 277/week @ 2020-11-20

991 downloads per month
Used in 17 crates (13 directly)

MIT license

205KB
4.5K SLoC

rust-id3

Build Status Crate Documentation

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

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

~2.5MB
~38K SLoC