# Magic data for file(1) command.
# Format is described in magic(5).
# Don't edit this file, edit /etc/magic or send your suggested inclusions to
# this file to submit@bugs.debian.org with `Package: file' as the first line
# in the body of the message.

# THIS IS A REDUCED VERSION TO BE USED ONLY WITH MP3do
# Stefano Falsetto <stefko5@inwind.it>

#------------------------------------------------------------------------------
# mmdf:  file(1) magic for MMDF mail files
#
0       string  \001\001\001\001        MMDF mailbox
#------------------------------------------------------------------------------
# modem:  file(1) magic for modem programs
#
# From: Florian La Roche <florian@knorke.saar.de>
4       string          Research,       Digifax-G3-File
>29     byte            1               , fine resolution
>29     byte            0               , normal resolution

0       short           0x0100          raw G3 data, byte-padded
0       short           0x1400          raw G3 data


# MPEG Audio (*.mpx)
# from dreesen@math.fu-berlin.de
0	beshort		&0xffe0		MPEG
# MPEG 1.0
>1	byte&0x08	=0x08		\b 1.0
# Layer 3
>>1	byte		&0x02		\b layer 3 audio stream data
>>>2	byte&0xf0	=0x10		\b,  32 kBit/s
>>>2	byte&0xf0	=0x20		\b,  40 kBit/s
>>>2	byte&0xf0	=0x30		\b,  48 kBit/s
>>>2	byte&0xf0	=0x40		\b,  56 kBit/s
>>>2	byte&0xf0	=0x50		\b,  64 kBit/s
>>>2	byte&0xf0	=0x60		\b,  80 kBit/s
>>>2	byte&0xf0	=0x70		\b,  96 kBit/s
>>>2	byte&0xf0	=0x80		\b, 112 kBit/s
>>>2	byte&0xf0	=0x90		\b, 128 kBit/s
>>>2	byte&0xf0	=0xA0		\b, 160 kBit/s
>>>2	byte&0xf0	=0xB0		\b, 192 kBit/s
>>>2	byte&0xf0	=0xC0		\b, 224 kBit/s
>>>2	byte&0xf0	=0xD0		\b, 256 kBit/s
>>>2	byte&0xf0	=0xE0		\b, 320 kBit/s
# Layer 2
>>1	byte		&0x04		\b layer 2 audio stream data
>>>2	byte&0xf0	=0x10		\b,  32 kBit/s
>>>2	byte&0xf0	=0x20		\b,  48 kBit/s
>>>2	byte&0xf0	=0x30		\b,  56 kBit/s
>>>2	byte&0xf0	=0x40		\b,  64 kBit/s
>>>2	byte&0xf0	=0x50		\b,  80 kBit/s
>>>2	byte&0xf0	=0x60		\b,  96 kBit/s
>>>2	byte&0xf0	=0x70		\b, 112 kBit/s
>>>2	byte&0xf0	=0x80		\b, 128 kBit/s
>>>2	byte&0xf0	=0x90		\b, 160 kBit/s
>>>2	byte&0xf0	=0xA0		\b, 192 kBit/s
>>>2	byte&0xf0	=0xB0		\b, 224 kBit/s
>>>2	byte&0xf0	=0xC0		\b, 256 kBit/s
>>>2	byte&0xf0	=0xD0		\b, 320 kBit/s
>>>2	byte&0xf0	=0xE0		\b, 384 kBit/s
# freq
>>2	byte&0x0C	=0x00		\b, 44.1 kHz
>>2	byte&0x0C	=0x04		\b, 48 kHz
>>2	byte&0x0C	=0x08		\b, 32 kHz
# MPEG 2.5
>1	byte&0x18	=0x00		\b 2.5
# Layer 3
>>1	byte		&0x02		\b layer 3 audio stream data
# Layer 2
>>1	byte		&0x04		\b layer 2 audio stream data
# MPEG 2.0
>1	byte&0x18	=0x10		\b 2.0
# Layer 3
>>1	byte		&0x02		\b layer 3 audio stream data
# Layer 2
>>1	byte		&0x04		\b layer 2 audio stream data
>>2	byte&0xf0	=0x10		\b,  8 kBit/s
>>2	byte&0xf0	=0x20		\b,  16 kBit/s
>>2	byte&0xf0	=0x30		\b,  24 kBit/s
>>2	byte&0xf0	=0x40		\b,  32 kBit/s
>>2	byte&0xf0	=0x50		\b,  40 kBit/s
>>2	byte&0xf0	=0x60		\b,  48 kBit/s
>>2	byte&0xf0	=0x70		\b,  56 kBit/s
>>2	byte&0xf0	=0x80		\b,  64 kBit/s
>>2	byte&0xf0	=0x90		\b,  80 kBit/s
>>2	byte&0xf0	=0xA0		\b,  96 kBit/s
>>2	byte&0xf0	=0xB0		\b, 112 kBit/s
>>2	byte&0xf0	=0xC0		\b, 128 kBit/s
>>2	byte&0xf0	=0xD0		\b, 144 kBit/s
>>2	byte&0xf0	=0xE0		\b, 160 kBit/s
# freq
>>2	byte&0x0C	=0x00		\b, 22.05 kHz
>>2	byte&0x0C	=0x04		\b, 24 kHz
>>2	byte&0x0C	=0x08		\b, 16 kHz
# misc
>3	byte&0xC0	=0x00		\b, stereo
>3	byte&0xC0	=0x40		\b, jstereo
>3	byte&0xC0	=0x80		\b, dual-ch
>3	byte&0xC0	=0xC0		\b, mono
#>1	byte&0x01	=0x00		\b, Error Protection
#>2	byte&0x02	=0x02		\b, Padding
#>2	byte&0x01	=0x01		\b, Private
#>3	byte&0x08	=0x08		\b, Copyright
#>3	byte&0x04	=0x04		\b, Original
#>3	byte&0x03	1		\b, Emphasis 5
#>3	byte&0x03	3		\b, Emphasis c

#------------------------------------------------------------------------------
# audio:  file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
# and others
#

# Sun/NeXT audio data
0	string		.snd		Sun/NeXT audio data:
>12	belong		1		8-bit ISDN u-law,
>12	belong		2		8-bit linear PCM [REF-PCM],
>12	belong		3		16-bit linear PCM,
>12	belong		4		24-bit linear PCM,
>12	belong		5		32-bit linear PCM,
>12	belong		6		32-bit IEEE floating point,
>12	belong		7		64-bit IEEE floating point,
>12	belong		23		8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
>12	belong		24		compressed (8-bit G.722 ADPCM)
>12	belong		25		compressed (3-bit G.723 ADPCM),
>12	belong		26		compressed (5-bit G.723 ADPCM),
>12	belong		27		8-bit A-law,
>20	belong		1		mono,
>20	belong		2		stereo,
>20	belong		4		quad,
>16	belong		>0		%d Hz

# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
# that uses little-endian encoding and has a different magic number
0	lelong		0x0064732E	DEC audio data:
>12	lelong		1		8-bit ISDN u-law,
>12	lelong		2		8-bit linear PCM [REF-PCM],
>12	lelong		3		16-bit linear PCM,
>12	lelong		4		24-bit linear PCM,
>12	lelong		5		32-bit linear PCM,
>12	lelong		6		32-bit IEEE floating point,
>12	lelong		7		64-bit IEEE floating point,
>12	lelong		23		8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
>20	lelong		1		mono,
>20	lelong		2		stereo,
>20	lelong		4		quad,
>16	lelong		>0		%d Hz

# Creative Labs AUDIO stuff
0	string	MThd			Standard MIDI data
>9 	byte	>0			(format %d)
>11	byte	>1			using %d tracks
0	string	CTMF			Creative Music (CMF) data
0	string	SBI			SoundBlaster instrument data
0	string	Creative\ Voice\ File	Creative Labs voice data
# is this next line right?  it came this way...
>19	byte	0x1A
>23	byte	>0			- version %d
>22	byte	>0			\b.%d

# first entry is also the string "NTRK"
0	belong		0x4e54524b	MultiTrack sound data
>4	belong		x		- version %ld

# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
0	string		EMOD		Extended MOD sound data,
>4	byte&0xf0	x		version %d
>4	byte&0x0f	x		\b.%d,
>45	byte		x		%d instruments
>83	byte		0		(module)
>83	byte		1		(song)

# Real Audio (Magic .ra\0375)
0	belong		0x2e7261fd	RealAudio sound file
0	string		.RMF		RealMedia file

# MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
# Oct 31, 1995
0	string		MTM		MultiTracker Module sound file
#0	string		if		Composer 669 Module sound data
0	string		FAR		Module sound data
0	string		MAS_U		ULT(imate) Module sound data
0x2c	string		SCRM		ScreamTracker III Module sound data
0	string		Extended Module	Extended Module sound data

# Gravis UltraSound patches
# From <ache@nagual.ru>

0	string		GF1PATCH110\0ID#000002\0	GUS patch
0	string		GF1PATCH100\0ID#000002\0	Old GUS	patch

#
# Taken from loader code from mikmod version 2.14
# by Steve McIntyre (stevem@chiark.greenend.org.uk)
0	string	JN		extended 669 module data
0	string	MAS_UTrack_V00
>14	string	>/0		ultratracker V1.%.1s module sound data
0	string	UN05		MikMod UNI format module sound data
0	string	Extended\ Module: Fasttracker II module sound data
21	string	!SCREAM!	Screamtracker 2 module sound data
1080	string	M.K.		4-channel Protracker module sound data
1080	string	M!K!		4-channel Protracker module sound data
1080	string	FLT4		4-channel Startracker module sound data
1080	string	4CHN		4-channel Fasttracker module sound data
1080	string	6CHN		6-channel Fasttracker module sound data
1080	string	8CHN		8-channel Fasttracker module sound data
1080	string	CD81		8-channel Oktalyzer module sound data
1080	string	OKTA		8-channel Oktalyzer module sound data
#1082	string	CH
#>1080	string	>/0		%.2s-channel Fasttracker "oktalyzer" module sound data
1080	string	16CN		16-channel Taketracker module sound data
1080	string	32CN		32-channel Taketracker module sound data

# TOC sound files -Trevor Johnson <trevor@jpj.net>
#
0       string          TOC             TOC sound file

# sidfiles <pooka@iki.fi>
0	string		SIDPLAY\ INFOFILE	Sidplay info file
0	string		PSID			PlaySID v2.2+ (AMIGA) sidtune
>4	beshort		>0			w/ header v%d,
>14	beshort		=1			single song,
>14	beshort		>1			%d songs,
>16	beshort		>0			default song: %d

# European GSM 06.10 is a provisional standard for full-rate speech
# transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
# excitation/long term prediction) coding at 13 kbit/s.
#
# There's only a magic nibble (4 bits); that nibble repeats every 33
# bytes.  This isn't suited for use, but maybe we can use it someday.
#
# This will cause very short GSM files to be declared as data and
# mismatches to be declared as data too!
#0	byte&0xF0	0xd0		data
#>33	byte&0xF0	0xd0
#>66	byte&0xF0	0xd0
#>99	byte&0xF0	0xd0
#>132	byte&0xF0	0xd0		GSM 06.10 compressed audio

#------------------------------------------------------------------------------
# iff:	file(1) magic for Interchange File Format (see also "audio" & "images")
#
# Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
# Arts for file interchange.  It has also been used by Apple, SGI, and
# especially Commodore-Amiga.
#
# IFF files begin with an 8 byte FORM header, followed by a 4 character
# FORM type, which is followed by the first chunk in the FORM.

0	string		FORM		IFF data
#>4	belong		x		\b, FORM is %d bytes long
# audio formats
>8	string		AIFF		\b, AIFF audio
>8	string		AIFC		\b, AIFF-C compressed audio
>8	string		8SVX		\b, 8SVX 8-bit sampled sound voice
>8	string		SAMP		\b, SAMP sampled audio
# image formats
>8	string		ILBMBMHD	\b, ILBM interleaved image
>>20	beshort		x		\b, %d x
>>22	beshort		x		%d
>8	string		RGBN		\b, RGBN 12-bit RGB image
>8	string		RGB8		\b, RGB8 24-bit RGB image
>8	string		DR2D		\b, DR2D 2-D object
>8	string		TDDD		\b, TDDD 3-D rendering
# other formats
>8	string		FTXT		\b, FTXT formatted text

#------------------------------------------------------------------------------
# riff:  file(1) magic for RIFF format
# See
#
#	http://www.seanet.com/users/matts/riffmci/riffmci.htm
#
# and
#
#	http://www.ora.com/centers/gff/formats/micriff/index.htm
#
# and
#
#	http://www.jtauber.com/music/encoding/niff/spec/
#
0	string		RIFF		RIFF (little-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	leshort		x		\b, version %d
>>18	leshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	leshort		12		\b, OS/2 1.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		64		\b, OS/2 2.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		40		\b, Windows 3.x format
>>>>34	lelong		x		\b, %d x
>>>>38	lelong		x		%d x
>>>>44	leshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>22	leshort		=1		\b, mono
>>22	leshort		=2		\b, stereo
>>22	leshort		>2		\b, %d channels
>>24	lelong		>0		%d Hz
# AVI == Audio Video Interleave
>8      string          AVI\            \b, AVI
# Animated Cursor format
>8	string		ACON		\b, animated cursor

#
# XXX - some of the below may only appear in little-endian form.
#
# Also "MV93" appears to be for one form of Macromedia Director
# files, and "GDMF" appears to be another multimedia format.
#
0	string		RIFX		RIFF (big-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	beshort		x		\b, version %d
>>18	beshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	beshort		12		\b, OS/2 1.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		64		\b, OS/2 2.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		40		\b, Windows 3.x format
>>>>34	belong		x		\b, %d x
>>>>38	belong		x		%d x
>>>>44	beshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>22	beshort		=1		\b, mono
>>22	beshort		=2		\b, stereo
>>22	beshort		>2		\b, %d channels
>>24	belong		>0		%d Hz
# AVI == Audio Video Interleave
>8      string          AVI\            \b, AVI
# Animated Cursor format
>8	string		ACON		\b, animated cursor
# Notation Interchange File Format (big-endian only)
>8	string		NIFF		\b, Notation Interchange File Format
