18 releases

0.4.1 Aug 1, 2022
0.4.0 Jul 31, 2022
0.2.7182 Oct 29, 2020
0.1.5 Oct 26, 2020
0.0.2 Oct 25, 2020

#31 in Audio

Download history 93/week @ 2023-06-04 44/week @ 2023-06-11 244/week @ 2023-06-18 158/week @ 2023-06-25 215/week @ 2023-07-02 113/week @ 2023-07-09 143/week @ 2023-07-16 149/week @ 2023-07-23 101/week @ 2023-07-30 153/week @ 2023-08-06 184/week @ 2023-08-13 1420/week @ 2023-08-20 992/week @ 2023-08-27 300/week @ 2023-09-03 220/week @ 2023-09-10 173/week @ 2023-09-17

1,947 downloads per month
Used in 8 crates (5 directly)

MIT license



Crate Crate Crate Documentation

This crate makes it easier to parse, convert and write metadata (a.k.a tag) in audio files of different file types.

This crate aims to provide a unified trait for parsers and writers of different audio file formats. This means that you can parse tags in mp3, flac, and m4a files with a single function: Tag::default(). read_from_path() and get fields by directly calling .album(), .artist() on its result. Without this crate, you would otherwise need to learn different APIs in id3, mp4ameta etc. in order to parse metadata in different file formats.


Using audiotags incurs a little overhead due to vtables if you want to guess the metadata format (from file extension). Apart from this the performance is almost the same as directly calling function provided by those 'specialized' crates.

No copies will be made if you only need to read and write metadata of one format. If you want to convert between tags, copying is unavoidable no matter if you use audiotags or use getters and setters provided by specialized libraries. audiotags is not making additional unnecessary copies.

Supported Formats

File Fomat Metadata Format backend
mp3 id3v2.4 id3
m4a/mp4/... MPEG-4 audio metadata mp4ameta
flac Vorbis comment metaflac


Read the manual for some examples, but here's a quick-one:

fn main() {
    // using `default()` or `new()` alone so that the metadata format is
    // guessed (from the file extension) (in this case, Id3v2 tag is read)
    let mut tag = Tag::new().read_from_path(MP3_FILE).unwrap();

    tag.set_title("foo title");
    assert_eq!(tag.title(), Some("foo title"));
    // trying to remove a field that's already empty won't hurt

    let cover = Picture {
        mime_type: MimeType::Jpeg,
        data: &vec![0u8; 10],

    assert_eq!(tag.album_cover(), Some(cover));

    tag.write_to_path(MP3_FILE).expect("Fail to save");

License: MIT


~42K SLoC