Crate mp4ameta[][src]

Expand description

A library for reading and writing iTunes style MPEG-4 audio metadata.

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();

Modules

ident

A module for working with identifiers.

Structs

AudioInfo

A struct containing information about a mp4 track.

Error

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

Fourcc

A 4 byte atom identifier (four character code).

FreeformIdent

An identifier of a freeform (----) atom containing borrowd mean and name strings.

Img

A struct representing an image.

Tag

A MPEG-4 audio tag containing metadata atoms

Enums

AdvisoryRating

An enum describing the rating of a file stored in the rtng atom.

ChannelConfig

An enum representing the channel configuration of an MPEG-4 audio track.

Data

An enum that holds different types of data defined by Table 3-5 Well-known data types.

DataIdent

An identifier for data.

ErrorKind

Kinds of errors that may occur while performing metadata operations.

ImgFmt

An enum representing image formats.

MediaType

An enum describing the media type of a file stored in the stik atom.

SampleRate

An enum representing the sample rate of an MPEG-4 audio track.

Constants

STANDARD_GENRES

A list of standard genre codes and values found in the gnre atom. The codes are equivalent to the ID3v1 genre codes plus 1.

Traits

Ident

A trait providing information about an identifier.

Type Definitions

ImgBuf

An alias for an owned image buffer.

ImgMut

An alias for a mutable image reference.

ImgRef

An alias for an image reference.

Result

Type alias for the result of tag operations.