misdetection of flac file w/id3 tag as mp3

Christos Zoulas christos at zoulas.com
Tue Mar 14 03:53:07 EET 2006


On Mar 13,  8:06pm, vapier at gentoo.org (Mike Frysinger) wrote:
-- Subject: misdetection of flac file w/id3 tag as mp3

| a Gentoo user filed Bug 124872 where they reported some of their flac files 
| being misreported as mp3s ... ive got an example file here:
| http://wh0rd.org/flacid3testcase.flac
| 
| both file-4.16 and file-4.17 show it as:
| MP3 file with ID3 version 2.3.0 tag
| -mike

Here's a patch... I might re-do it later.

christos

Index: audio
===================================================================
RCS file: /src/pub/file/magic/Magdir/audio,v
retrieving revision 1.38
diff -u -u -r1.38 audio
--- audio	2 Mar 2006 22:10:26 -0000	1.38
+++ audio	14 Mar 2006 01:52:26 -0000
@@ -221,9 +221,41 @@
 # SGI SoundTrack <mpruett at sgi.com>
 0	string		_SGI_SoundTrack		SGI SoundTrack project file
 # ID3 version 2 tags <waschk at informatik.uni-rostock.de>
-0	string		ID3	MP3 file with ID3 version 2.
+0	string		ID3	Audio file with ID3 version 2
 >3	ubyte	<0xff	\b%d.
 >4	ubyte	<0xff	\b%d tag
+>2584	string	fLaC		\b, FLAC encoding
+>>2588	byte&0x7f		>0		\b, unknown version
+>>2588	byte&0x7f		0		\b
+# some common bits/sample values
+>>>2600	beshort&0x1f0		0x030		\b, 4 bit
+>>>2600	beshort&0x1f0		0x050		\b, 6 bit
+>>>2600	beshort&0x1f0		0x070		\b, 8 bit
+>>>2600	beshort&0x1f0		0x0b0		\b, 12 bit
+>>>2600	beshort&0x1f0		0x0f0		\b, 16 bit
+>>>2600	beshort&0x1f0		0x170		\b, 24 bit
+>>>2600	byte&0xe		0x0		\b, mono
+>>>2600	byte&0xe		0x2		\b, stereo
+>>>2600	byte&0xe		0x4		\b, 3 channels
+>>>2600	byte&0xe		0x6		\b, 4 channels
+>>>2600	byte&0xe		0x8		\b, 5 channels
+>>>2600	byte&0xe		0xa		\b, 6 channels
+>>>2600	byte&0xe		0xc		\b, 7 channels
+>>>2600	byte&0xe		0xe		\b, 8 channels
+# some common sample rates
+>>>2597	belong&0xfffff0		0x0ac440	\b, 44.1 kHz
+>>>2597	belong&0xfffff0		0x0bb800	\b, 48 kHz
+>>>2597	belong&0xfffff0		0x07d000	\b, 32 kHz
+>>>2597	belong&0xfffff0		0x056220	\b, 22.05 kHz
+>>>2597	belong&0xfffff0		0x05dc00	\b, 24 kHz
+>>>2597	belong&0xfffff0		0x03e800	\b, 16 kHz
+>>>2597	belong&0xfffff0		0x02b110	\b, 11.025 kHz
+>>>2597	belong&0xfffff0		0x02ee00	\b, 12 kHz
+>>>2597	belong&0xfffff0		0x01f400	\b, 8 kHz
+>>>2597	belong&0xfffff0		0x177000	\b, 96 kHz
+>>>2597	belong&0xfffff0		0x0fa000	\b, 64 kHz
+>>>2601	byte&0xf		>0		\b, >4G samples
+>2584	string	!fLaC		\b, MP3 encoding
 
 # NSF (NES sound file) magic
 0	string		NESM\x1a	NES Sound File



More information about the File mailing list