# Extracts mp3 files with the ID3v2 tag.
# Depends on perl and mpg123 from http://www.mpg123.de/ 
#
# If you use this together with the mp3-id3v1 recipe, specify this recipe
# BEFORE the other. Otherwise files will be extracted twice.
#
# From http://www.id3.org/id3v2.4.0-structure.txt:
#   An ID3v2 tag can be detected with the following pattern:
#   49 44 33 yy yy xx zz zz zz zz
# where yy is the version, xx are flags (only bit 4-7 used) and zz are integers
# less than 0x80
# We assume that ID3v2 versions only come as 2.x.y, where x and y is less than 7
0 string ID3
2 int32 00000000 00f8F80f
6 int32 00000000 80808080
extension mp3
command mp3extract.pl "$1"
min_output_file 51200
