#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

#25 in Audio

Download history 199/week @ 2018-10-27 137/week @ 2018-11-03 127/week @ 2018-11-10 45/week @ 2018-11-17 115/week @ 2018-11-24 91/week @ 2018-12-01 43/week @ 2018-12-08 52/week @ 2018-12-15 47/week @ 2018-12-22 42/week @ 2018-12-29 44/week @ 2019-01-05 39/week @ 2019-01-12 47/week @ 2019-01-19 14/week @ 2019-01-26 17/week @ 2019-02-02

231 downloads per month
Used in 3 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
~107K SLoC