summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1998-11-25 11:01:14 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1998-11-25 11:01:14 +0000
commit0c0be5915bf26f87d883d873cb9a8b716a946ec5 (patch)
tree422b97f7271ae9448caa35e3cb80258509ce7733 /usr.bin
parent365336b374f907fb36ef16f668084eac9b0259cf (diff)
Mpeg audio identification from ckane@best.com
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/file/magdir/audio137
1 files changed, 137 insertions, 0 deletions
diff --git a/usr.bin/file/magdir/audio b/usr.bin/file/magdir/audio
index b4db4e9c18c..e34bd6f575e 100644
--- a/usr.bin/file/magdir/audio
+++ b/usr.bin/file/magdir/audio
@@ -88,3 +88,140 @@
#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
+
+#------------------------
+# MPEG: file(1) magic for MPEG audio.
+#
+# From <ckane@best.com>
+# Show MPEG level, layer, kbit/s, hz, stereo/mono for an MPG audio file.
+# This section is lengthy because the kbit/s rate depends on the
+# level and layer, and file(1) doesn't allow math on the values.
+#
+
+####### MPEG begins with three hex 'f' nibbles.
+0 beshort&0xfff0 0xfff0 MPEG
+####### Level 2
+>1 byte&0x08 0x00 2.0
+>>1 byte&0x06 0x00 Layer Unknown,
+####### Level 2, Layers I, II, and III
+>>1 byte&0x06 0x02 Layer III,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 8 kbit/s,
+>>>2 byte&0xf0 0x20 16 kbit/s,
+>>>2 byte&0xf0 0x30 24 kbit/s,
+>>>2 byte&0xf0 0x40 32 kbit/s,
+>>>2 byte&0xf0 0x50 40 kbit/s,
+>>>2 byte&0xf0 0x60 48 kbit/s,
+>>>2 byte&0xf0 0x70 56 kbit/s,
+>>>2 byte&0xf0 0x80 64 kbit/s,
+>>>2 byte&0xf0 0x90 80 kbit/s,
+>>>2 byte&0xf0 0xa0 96 kbit/s,
+>>>2 byte&0xf0 0xb0 112 kbit/s,
+>>>2 byte&0xf0 0xc0 128 kbit/s,
+>>>2 byte&0xf0 0xd0 144 kbit/s,
+>>>2 byte&0xf0 0xe0 160 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+>>1 byte&0x06 0x04 Layer II,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 8 kbit/s,
+>>>2 byte&0xf0 0x20 16 kbit/s,
+>>>2 byte&0xf0 0x30 24 kbit/s,
+>>>2 byte&0xf0 0x40 32 kbit/s,
+>>>2 byte&0xf0 0x50 40 kbit/s,
+>>>2 byte&0xf0 0x60 48 kbit/s,
+>>>2 byte&0xf0 0x70 56 kbit/s,
+>>>2 byte&0xf0 0x80 64 kbit/s,
+>>>2 byte&0xf0 0x90 80 kbit/s,
+>>>2 byte&0xf0 0xa0 96 kbit/s,
+>>>2 byte&0xf0 0xb0 112 kbit/s,
+>>>2 byte&0xf0 0xc0 128 kbit/s,
+>>>2 byte&0xf0 0xd0 144 kbit/s,
+>>>2 byte&0xf0 0xe0 160 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+>>1 byte&0x06 0x06 Layer I,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 32 kbit/s,
+>>>2 byte&0xf0 0x20 48 kbit/s,
+>>>2 byte&0xf0 0x30 56 kbit/s,
+>>>2 byte&0xf0 0x40 64 kbit/s,
+>>>2 byte&0xf0 0x50 80 kbit/s,
+>>>2 byte&0xf0 0x60 96 kbit/s,
+>>>2 byte&0xf0 0x70 112 kbit/s,
+>>>2 byte&0xf0 0x80 128 kbit/s,
+>>>2 byte&0xf0 0x90 144 kbit/s,
+>>>2 byte&0xf0 0xa0 160 kbit/s,
+>>>2 byte&0xf0 0xb0 176 kbit/s,
+>>>2 byte&0xf0 0xc0 192 kbit/s,
+>>>2 byte&0xf0 0xd0 224 kbit/s,
+>>>2 byte&0xf0 0xe0 256 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+####### Level 2, Hz
+>>2 byte&0x0c 0x00 22050 Hz
+>>2 byte&0x0c 0x04 24000 Hz
+>>2 byte&0x0c 0x08 16000 Hz
+>>2 byte&0x0c 0x0c ? Hz
+####### Level 1 decoding
+>1 byte&0x08 0x08 1.0
+>>1 byte&0x06 0x00 Layer Unknown.
+####### Level 1, Layers I, II, and III
+>>1 byte&0x06 0x02 Layer III,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 32 kbit/s,
+>>>2 byte&0xf0 0x20 40 kbit/s,
+>>>2 byte&0xf0 0x30 48 kbit/s,
+>>>2 byte&0xf0 0x40 56 kbit/s,
+>>>2 byte&0xf0 0x50 64 kbit/s,
+>>>2 byte&0xf0 0x60 80 kbit/s,
+>>>2 byte&0xf0 0x70 96 kbit/s,
+>>>2 byte&0xf0 0x80 112 kbit/s,
+>>>2 byte&0xf0 0x90 128 kbit/s,
+>>>2 byte&0xf0 0xa0 160 kbit/s,
+>>>2 byte&0xf0 0xb0 192 kbit/s,
+>>>2 byte&0xf0 0xc0 224 kbit/s,
+>>>2 byte&0xf0 0xd0 256 kbit/s,
+>>>2 byte&0xf0 0xe0 320 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+>>1 byte&0x06 0x04 Layer II,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 32 kbit/s,
+>>>2 byte&0xf0 0x20 48 kbit/s,
+>>>2 byte&0xf0 0x30 56 kbit/s,
+>>>2 byte&0xf0 0x40 64 kbit/s,
+>>>2 byte&0xf0 0x50 80 kbit/s,
+>>>2 byte&0xf0 0x60 96 kbit/s,
+>>>2 byte&0xf0 0x70 112 kbit/s,
+>>>2 byte&0xf0 0x80 128 kbit/s,
+>>>2 byte&0xf0 0x90 160 kbit/s,
+>>>2 byte&0xf0 0xa0 192 kbit/s,
+>>>2 byte&0xf0 0xb0 224 kbit/s,
+>>>2 byte&0xf0 0xc0 256 kbit/s,
+>>>2 byte&0xf0 0xd0 320 kbit/s,
+>>>2 byte&0xf0 0xe0 384 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+>>1 byte&0x06 0x06 Layer I,
+>>>2 byte&0xf0 0x00 0 kbit/s,
+>>>2 byte&0xf0 0x10 32 kbit/s,
+>>>2 byte&0xf0 0x20 64 kbit/s,
+>>>2 byte&0xf0 0x30 96 kbit/s,
+>>>2 byte&0xf0 0x40 128 kbit/s,
+>>>2 byte&0xf0 0x50 160 kbit/s,
+>>>2 byte&0xf0 0x60 192 kbit/s,
+>>>2 byte&0xf0 0x70 224 kbit/s,
+>>>2 byte&0xf0 0x80 256 kbit/s,
+>>>2 byte&0xf0 0x90 288 kbit/s,
+>>>2 byte&0xf0 0xa0 320 kbit/s,
+>>>2 byte&0xf0 0xb0 352 kbit/s,
+>>>2 byte&0xf0 0xc0 384 kbit/s,
+>>>2 byte&0xf0 0xd0 416 kbit/s,
+>>>2 byte&0xf0 0xe0 448 kbit/s,
+>>>2 byte&0xf0 0xf0 ? kbit/s,
+####### Level 2, Hz
+>>2 byte&0x0c 0x00 44100 Hz
+>>2 byte&0x0c 0x04 48000 Hz
+>>2 byte&0x0c 0x08 32000 Hz
+>>2 byte&0x0c 0x0c ? Hz
+####### Stereo or Mono
+>3 byte&0xc0 0x00 stereo
+>3 byte&0xc0 0x40 joint-stereo
+>3 byte&0xc0 0x80 dual-channel
+>3 byte&0xc0 0xc0 mono