#audio-metadata #accessor #style #reading #mpeg-4 #itunes #mp4ameta

macro mp4ameta_proc

Procedural macros to generate common accessors for the mp4ameta crate

8 releases (5 breaking)

0.6.0 Jun 15, 2021
0.5.0 Apr 18, 2021
0.4.0 Feb 14, 2021
0.3.0 Feb 6, 2021
0.1.0 Sep 27, 2020

#5 in #itunes

Download history 164/week @ 2023-11-29 188/week @ 2023-12-06 230/week @ 2023-12-13 204/week @ 2023-12-20 123/week @ 2023-12-27 217/week @ 2024-01-03 320/week @ 2024-01-10 333/week @ 2024-01-17 312/week @ 2024-01-24 401/week @ 2024-01-31 551/week @ 2024-02-07 242/week @ 2024-02-14 382/week @ 2024-02-21 561/week @ 2024-02-28 481/week @ 2024-03-06 641/week @ 2024-03-13

2,107 downloads per month
Used in 17 crates (via mp4ameta)

MIT/Apache

10KB
267 lines

mp4ameta

Build Style Crate Documentation License LOC

A library for reading and writing iTunes style MPEG-4 audio metadata. Most commonly this kind of metadata is found inside m4a or m4b files but basically any mp4 container supports it.

Examples

The easy way

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

println!("{}", tag.artist().unwrap());

tag.set_artist("artist");
tag.write_to_path("music.m4a").unwrap();

The hard way

use mp4ameta::{Data, Fourcc, Tag};

let mut tag = Tag::read_from_path("music.m4a").unwrap();
let artist_ident = Fourcc(*b"\xa9ART");

let artist = tag.strings_of(&artist_ident).next().unwrap();
println!("{}", artist);

tag.set_data(artist_ident, Data::Utf8("artist".to_owned()));
tag.write_to_path("music.m4a").unwrap();

Using freeform identifiers

use mp4ameta::{Data, FreeformIdent, Tag};

let mut tag = Tag::read_from_path("music.m4a").unwrap();
let isrc_ident = FreeformIdent::new("com.apple.iTunes", "ISRC");

let isrc = tag.strings_of(&isrc_ident).next().unwrap();
println!("{}", isrc);

tag.set_data(isrc_ident, Data::Utf8("isrc".to_owned()));
tag.write_to_path("music.m4a").unwrap();

Testing

__Run all tests:__
cargo test

__Test this library on your collection:__
cargo test -- --nocapture collection <path>

No runtime deps