mp3>id3 ( path -- id3/f )
ID3 tags
Prev:mp3-paths>id3s ( seq -- seq' )
Next:album ( id3 -- string/f )


Vocabulary
id3

Inputs and outputs
patha path string
id3/fa tuple storing ID3v2 metadata or f


Word description
Return a tuple containing the ID3 information parsed out of the MP3 file, or f if no metadata is present. Words to access the ID3v1 information are here:
title
artist
album
year
genre
comment

For other fields, use the find-id3-frame word.

Definition
USING: alien.c-types id3.private io.mmap kernel ;

IN: id3

: mp3>id3 ( path -- id3/f )
[
[ <id3> ] dip uchar <mapped-array>
[ dup id3v1? [ read-v1-tags merge-id3v1 ] [ drop ] if ]
[
dup id3v1+?
[ read-v1+-tags merge-id3v1 ] [ drop ] if
] [ dup id3v2? [ read-v2-tags ] [ drop ] if ] tri
] with-mapped-file-reader ;