Expand description
Audio file metadata / tag parsing extracted from Rockbox as a reusable library.
One call parses tags, duration, bitrate, sample rate, ReplayGain and embedded album-art / cuesheet positions for 40+ audio formats — MP3 (ID3v1/v2), FLAC, Ogg Vorbis, Opus, Speex, MP4/M4A (AAC & ALAC), WavPack, Monkey’s Audio, Musepack, WMA, AIFF, WAV/AU/VOX, TTA, ADX, SHN, and the chiptune family (SPC, NSF, SID, VGM, KSS, AY, GBS, HES, SGC, VTX, MOD, SAP, …).
let meta = rockbox_metadata::read("song.flac").unwrap();
println!(
"{} — {} [{}] {:?}",
meta.artist, meta.title, meta.codec, meta.duration,
);The parsers are the battle-tested Rockbox C sources
(lib/rbcodec/metadata/), compiled by build.rs and bridged through a
small flat struct (shim/rbmeta.h). Pairs with the
rockbox-dsp crate: the raw
Q7.24 ReplayGain values from ReplayGain feed directly into its
set_replaygain_gains_raw().
Structs§
- Album
Art - Location of album art embedded in the audio file (ID3 APIC, FLAC
PICTURE, MP4
covr). Readsizebytes at byteoffsetto extract the image — unless one of the transform flags is set, in which case the data first needs ID3 de-unsynchronization or base64 decoding. - Cuesheet
- Location of a cuesheet embedded in the file’s tags.
- Metadata
- Parsed metadata for one audio file.
- Replay
Gain - ReplayGain values parsed from the file’s tags.
Enums§
- Album
ArtKind - Image format of embedded album art.
- CueEncoding
- Character encoding of an embedded cuesheet.
- Error
- Errors returned by
read.