Crate id3 [] [src]

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;

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

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

tag.save().unwrap();

Creating a new tag

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

let mut tag = Tag::with_version(4);
 
// set the album the hard way
let mut frame = Frame::new("TALB");
frame.encoding = Encoding::UTF8;
frame.content = Content::Text("album".to_owned());
tag.push(frame);

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

tag.write_to_path("music.mp3").unwrap();

Reexports

pub use frame::Frame;

Modules

frame

Contains types and methods for operating on ID3 frames.

util

Utilities used for reading/writing ID3 tags.

Structs

Error

A structure able to represent any error that may occur while performing metadata operations.

Tag

An ID3 tag containing metadata frames.

Enums

ErrorKind

Kinds of errors that may occur while performing metadata operations.

Type Definitions

Result

Type alias for the result of tag operations.