Crates.io | mp4ameta |
lib.rs | mp4ameta |
version | 0.11.0 |
source | src |
created_at | 2020-03-26 02:55:20.30543 |
updated_at | 2021-06-15 22:31:48.410383 |
description | A library for reading and writing iTunes style MPEG-4 audio metadata. |
homepage | |
repository | https://github.com/Saecki/rust-mp4ameta |
max_upload_size | |
id | 222969 |
size | 1,008,817 |
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.
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();
use mp4ameta::{Data, Fourcc, Tag};
let mut tag = Tag::read_from_path("music.m4a").unwrap();
let artist_ident = Fourcc(*b"\xa9ART");
let artist = tag.string(&artist_ident).next().unwrap();
println!("{}", artist);
tag.set_data(artist_ident, Data::Utf8("artist".to_owned()));
tag.write_to_path("music.m4a").unwrap();
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.string(&isrc_ident).next().unwrap();
println!("{}", isrc);
tag.set_data(isrc_ident, Data::Utf8("isrc".to_owned()));
tag.write_to_path("music.m4a").unwrap();
Run all tests:
cargo test
Test this library on your collection:
cargo test -- --nocapture collection <path>