audio 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. #------------------------------------------------------------------------------
  2. # audio: file(1) magic for sound formats (see also "iff")
  3. #
  4. # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
  5. # and others
  6. #
  7. # Sun/NeXT audio data
  8. 0 string .snd Sun/NeXT audio data:
  9. >12 belong 1 8-bit ISDN mu-law,
  10. >12 belong 2 8-bit linear PCM [REF-PCM],
  11. >12 belong 3 16-bit linear PCM,
  12. >12 belong 4 24-bit linear PCM,
  13. >12 belong 5 32-bit linear PCM,
  14. >12 belong 6 32-bit IEEE floating point,
  15. >12 belong 7 64-bit IEEE floating point,
  16. >12 belong 8 Fragmented sample data,
  17. >12 belong 10 DSP program,
  18. >12 belong 11 8-bit fixed point,
  19. >12 belong 12 16-bit fixed point,
  20. >12 belong 13 24-bit fixed point,
  21. >12 belong 14 32-bit fixed point,
  22. >12 belong 18 16-bit linear with emphasis,
  23. >12 belong 19 16-bit linear compressed,
  24. >12 belong 20 16-bit linear with emphasis and compression,
  25. >12 belong 21 Music kit DSP commands,
  26. >12 belong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
  27. >12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
  28. >12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
  29. >12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
  30. >12 belong 27 8-bit A-law (CCITT G.711),
  31. >20 belong 1 mono,
  32. >20 belong 2 stereo,
  33. >20 belong 4 quad,
  34. >16 belong >0 %d Hz
  35. # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
  36. # that uses little-endian encoding and has a different magic number
  37. 0 lelong 0x0064732E DEC audio data:
  38. >12 lelong 1 8-bit ISDN mu-law,
  39. >12 lelong 2 8-bit linear PCM [REF-PCM],
  40. >12 lelong 3 16-bit linear PCM,
  41. >12 lelong 4 24-bit linear PCM,
  42. >12 lelong 5 32-bit linear PCM,
  43. >12 lelong 6 32-bit IEEE floating point,
  44. >12 lelong 7 64-bit IEEE floating point,
  45. >12 belong 8 Fragmented sample data,
  46. >12 belong 10 DSP program,
  47. >12 belong 11 8-bit fixed point,
  48. >12 belong 12 16-bit fixed point,
  49. >12 belong 13 24-bit fixed point,
  50. >12 belong 14 32-bit fixed point,
  51. >12 belong 18 16-bit linear with emphasis,
  52. >12 belong 19 16-bit linear compressed,
  53. >12 belong 20 16-bit linear with emphasis and compression,
  54. >12 belong 21 Music kit DSP commands,
  55. >12 lelong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
  56. >12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
  57. >12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
  58. >12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
  59. >12 belong 27 8-bit A-law (CCITT G.711),
  60. >20 lelong 1 mono,
  61. >20 lelong 2 stereo,
  62. >20 lelong 4 quad,
  63. >16 lelong >0 %d Hz
  64. # Creative Labs AUDIO stuff
  65. 0 string MThd Standard MIDI data
  66. >8 beshort x (format %d)
  67. >10 beshort x using %d track
  68. >10 beshort >1 \bs
  69. >12 beshort&0x7fff x at 1/%d
  70. >12 beshort&0x8000 >0 SMPTE
  71. 0 string CTMF Creative Music (CMF) data
  72. 0 string SBI SoundBlaster instrument data
  73. 0 string Creative\ Voice\ File Creative Labs voice data
  74. # is this next line right? it came this way...
  75. >19 byte 0x1A
  76. >23 byte >0 - version %d
  77. >22 byte >0 \b.%d
  78. # first entry is also the string "NTRK"
  79. 0 belong 0x4e54524b MultiTrack sound data
  80. >4 belong x - version %ld
  81. # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
  82. # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
  83. 0 string EMOD Extended MOD sound data,
  84. >4 byte&0xf0 x version %d
  85. >4 byte&0x0f x \b.%d,
  86. >45 byte x %d instruments
  87. >83 byte 0 (module)
  88. >83 byte 1 (song)
  89. # Real Audio (Magic .ra\0375)
  90. 0 belong 0x2e7261fd RealAudio sound file
  91. 0 string .RMF RealMedia file
  92. # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
  93. # Oct 31, 1995
  94. # fixed by <doj@cubic.org> 2003-06-24
  95. # Too short...
  96. #0 string MTM MultiTracker Module sound file
  97. #0 string if Composer 669 Module sound data
  98. #0 string JN Composer 669 Module sound data (extended format)
  99. 0 string MAS_U ULT(imate) Module sound data
  100. #0 string FAR Module sound data
  101. #>4 string >\15 Title: "%s"
  102. 0x2c string SCRM ScreamTracker III Module sound data
  103. >0 string >\0 Title: "%s"
  104. # Gravis UltraSound patches
  105. # From <ache@nagual.ru>
  106. 0 string GF1PATCH110\0ID#000002\0 GUS patch
  107. 0 string GF1PATCH100\0ID#000002\0 Old GUS patch
  108. #
  109. # Taken from loader code from mikmod version 2.14
  110. # by Steve McIntyre (stevem@chiark.greenend.org.uk)
  111. # <doj@cubic.org> added title printing on 2003-06-24
  112. 0 string MAS_UTrack_V00
  113. >14 string >/0 ultratracker V1.%.1s module sound data
  114. 0 string UN05 MikMod UNI format module sound data
  115. 0 string Extended\ Module: Fasttracker II module sound data
  116. >17 string >\0 Title: "%s"
  117. 21 string/c =!SCREAM! Screamtracker 2 module sound data
  118. 21 string BMOD2STM Screamtracker 2 module sound data
  119. 1080 string M.K. 4-channel Protracker module sound data
  120. >0 string >\0 Title: "%s"
  121. 1080 string M!K! 4-channel Protracker module sound data
  122. >0 string >\0 Title: "%s"
  123. 1080 string FLT4 4-channel Startracker module sound data
  124. >0 string >\0 Title: "%s"
  125. 1080 string FLT8 8-channel Startracker module sound data
  126. >0 string >\0 Title: "%s"
  127. 1080 string 4CHN 4-channel Fasttracker module sound data
  128. >0 string >\0 Title: "%s"
  129. 1080 string 6CHN 6-channel Fasttracker module sound data
  130. >0 string >\0 Title: "%s"
  131. 1080 string 8CHN 8-channel Fasttracker module sound data
  132. >0 string >\0 Title: "%s"
  133. 1080 string CD81 8-channel Octalyser module sound data
  134. >0 string >\0 Title: "%s"
  135. 1080 string OKTA 8-channel Oktalyzer module sound data
  136. >0 string >\0 Title: "%s"
  137. # Not good enough.
  138. #1082 string CH
  139. #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
  140. 1080 string 16CN 16-channel Taketracker module sound data
  141. >0 string >\0 Title: "%s"
  142. 1080 string 32CN 32-channel Taketracker module sound data
  143. >0 string >\0 Title: "%s"
  144. # TOC sound files -Trevor Johnson <trevor@jpj.net>
  145. #
  146. 0 string TOC TOC sound file
  147. # sidfiles <pooka@iki.fi>
  148. # added name,author,(c) and new RSID type by <doj@cubic.org> 2003-06-24
  149. 0 string SIDPLAY\ INFOFILE Sidplay info file
  150. 0 string PSID PlaySID v2.2+ (AMIGA) sidtune
  151. >4 beshort >0 w/ header v%d,
  152. >14 beshort =1 single song,
  153. >14 beshort >1 %d songs,
  154. >16 beshort >0 default song: %d
  155. >0x16 string >\0 name: "%s"
  156. >0x36 string >\0 author: "%s"
  157. >0x56 string >\0 copyright: "%s"
  158. 0 string RSID RSID sidtune PlaySID compatible
  159. >4 beshort >0 w/ header v%d,
  160. >14 beshort =1 single song,
  161. >14 beshort >1 %d songs,
  162. >16 beshort >0 default song: %d
  163. >0x16 string >\0 name: "%s"
  164. >0x36 string >\0 author: "%s"
  165. >0x56 string >\0 copyright: "%s"
  166. # IRCAM <mpruett@sgi.com>
  167. # VAX and MIPS files are little-endian; Sun and NeXT are big-endian
  168. 0 belong 0x64a30100 IRCAM file (VAX)
  169. 0 belong 0x64a30200 IRCAM file (Sun)
  170. 0 belong 0x64a30300 IRCAM file (MIPS little-endian)
  171. 0 belong 0x64a30400 IRCAM file (NeXT)
  172. # NIST SPHERE <mpruett@sgi.com>
  173. 0 string NIST_1A\n\ \ \ 1024\n NIST SPHERE file
  174. # Sample Vision <mpruett@sgi.com>
  175. 0 string SOUND\ SAMPLE\ DATA\ Sample Vision file
  176. # Audio Visual Research <tonigonenstein@users.sourceforge.net>
  177. 0 string 2BIT Audio Visual Research file,
  178. >12 beshort =0 mono,
  179. >12 beshort =-1 stereo,
  180. >14 beshort x %d bits
  181. >16 beshort =0 unsigned,
  182. >16 beshort =-1 signed,
  183. >22 belong&0x00ffffff x %d Hz,
  184. >18 beshort =0 no loop,
  185. >18 beshort =-1 loop,
  186. >21 ubyte <=127 note %d,
  187. >22 byte =0 replay 5.485 KHz
  188. >22 byte =1 replay 8.084 KHz
  189. >22 byte =2 replay 10.971 Khz
  190. >22 byte =3 replay 16.168 Khz
  191. >22 byte =4 replay 21.942 KHz
  192. >22 byte =5 replay 32.336 KHz
  193. >22 byte =6 replay 43.885 KHz
  194. >22 byte =7 replay 47.261 KHz
  195. # SGI SoundTrack <mpruett@sgi.com>
  196. 0 string _SGI_SoundTrack SGI SoundTrack project file
  197. # ID3 version 2 tags <waschk@informatik.uni-rostock.de>
  198. 0 string ID3 MP3 file with ID3 version 2.
  199. >3 ubyte <0xff \b%d.
  200. >4 ubyte <0xff \b%d tag
  201. # NSF (NES sound file) magic
  202. 0 string NESM\x1a NES Sound File
  203. >14 string >\0 ("%s" by
  204. >46 string >\0 %s, copyright
  205. >78 string >\0 %s),
  206. >5 byte x version %d,
  207. >6 byte x %d tracks,
  208. >122 byte&0x2 =1 dual PAL/NTSC
  209. >122 byte&0x1 =1 PAL
  210. >122 byte&0x1 =0 NTSC
  211. # Impuse tracker module (audio/x-it)
  212. 0 string IMPM Impulse Tracker module sound data -
  213. >4 string >\0 "%s"
  214. >40 leshort !0 compatible w/ITv%x
  215. >42 leshort !0 created w/ITv%x
  216. # Imago Orpheus module (audio/x-imf)
  217. 60 string IM10 Imago Orpheus module sound data -
  218. >0 string >\0 "%s"
  219. # From <collver1@attbi.com>
  220. # These are the /etc/magic entries to decode modules, instruments, and
  221. # samples in Impulse Tracker's native format.
  222. 0 string IMPS Impulse Tracker Sample
  223. >18 byte &2 16 bit
  224. >18 byte ^2 8 bit
  225. >18 byte &4 stereo
  226. >18 byte ^4 mono
  227. 0 string IMPI Impulse Tracker Instrument
  228. >28 leshort !0 ITv%x
  229. >30 byte !0 %d samples
  230. # Yamaha TX Wave: file(1) magic for Yamaha TX Wave audio files
  231. # From <collver1@attbi.com>
  232. 0 string LM8953 Yamaha TX Wave
  233. >22 byte 0x49 looped
  234. >22 byte 0xC9 non-looped
  235. >23 byte 1 33kHz
  236. >23 byte 2 50kHz
  237. >23 byte 3 16kHz
  238. # scream tracker: file(1) magic for Scream Tracker sample files
  239. #
  240. # From <collver1@attbi.com>
  241. 76 string SCRS Scream Tracker Sample
  242. >0 byte 1 sample
  243. >0 byte 2 adlib melody
  244. >0 byte >2 adlib drum
  245. >31 byte &2 stereo
  246. >31 byte ^2 mono
  247. >31 byte &4 16bit little endian
  248. >31 byte ^4 8bit
  249. >30 byte 0 unpacked
  250. >30 byte 1 packed
  251. # audio
  252. # From: Cory Dikkers <cdikkers@swbell.net>
  253. 0 string MMD0 MED music file, version 0
  254. 0 string MMD1 OctaMED Pro music file, version 1
  255. 0 string MMD3 OctaMED Soundstudio music file, version 3
  256. 0 string OctaMEDCmpr OctaMED Soundstudio compressed file
  257. 0 string MED MED_Song
  258. 0 string SymM Symphonie SymMOD music file
  259. #
  260. 0 string THX AHX version
  261. >3 byte =0 1 module data
  262. >3 byte =1 2 module data
  263. #
  264. 0 string OKTASONG Oktalyzer module data
  265. #
  266. 0 string DIGI\ Booster\ module\0 %s
  267. >20 byte >0 %c
  268. >>21 byte >0 \b%c
  269. >>>22 byte >0 \b%c
  270. >>>>23 byte >0 \b%c
  271. >610 string >\0 \b, "%s"
  272. #
  273. 0 string DBM0 DIGI Booster Pro Module
  274. >4 byte >0 V%X.
  275. >>5 byte x \b%02X
  276. >16 string >\0 \b, "%s"
  277. #
  278. 0 string FTMN FaceTheMusic module
  279. >16 string >\0d \b, "%s"
  280. # From: <doj@cubic.org> 2003-06-24
  281. 0 string AMShdr\32 Velvet Studio AMS Module v2.2
  282. 0 string Extreme Extreme Tracker AMS Module v1.3
  283. 0 string DDMF Xtracker DMF Module
  284. >4 byte x v%i
  285. >0xD string >\0 Title: "%s"
  286. >0x2B string >\0 Composer: "%s"
  287. 0 string DSM\32 Dynamic Studio Module DSM
  288. 0 string SONG DigiTrekker DTM Module
  289. 0 string DMDL DigiTrakker MDL Module
  290. 0 string PSM\32 Protracker Studio PSM Module
  291. 44 string PTMF Poly Tracker PTM Module
  292. >0 string >\32 Title: "%s"
  293. 0 string MT20 MadTracker 2.0 Module MT2
  294. 0 string RAD\40by\40REALiTY!! RAD Adlib Tracker Module RAD
  295. 0 string RTMM RTM Module
  296. 0x426 string MaDoKaN96 XMS Adlib Module
  297. >0 string >\0 Composer: "%s"
  298. 0 string AMF AMF Module
  299. >4 string >\0 Title: "%s"
  300. 0 string MODINFO1 Open Cubic Player Module Inforation MDZ
  301. 0 string Extended\40Instrument: Fast Tracker II Instrument
  302. # From: Takeshi Hamasaki <hma@syd.odn.ne.jp>
  303. # NOA Nancy Codec file
  304. 0 string \210NOA\015\012\032 NOA Nancy Codec Movie file
  305. # Yamaha SMAF format
  306. 0 string MMMD Yamaha SMAF file
  307. # Sharp Jisaku Melody format for PDC
  308. 0 string \001Sharp\040JisakuMelody SHARP Cell-Phone ringing Melody
  309. >20 string Ver01.00 Ver. 1.00
  310. >>32 byte x , %d tracks
  311. # Free lossless audio codec <http://flac.sourceforge.net>
  312. # From: Przemyslaw Augustyniak <silvathraec@rpg.pl>
  313. 0 string fLaC FLAC audio bitstream data
  314. >4 byte&0x7f >0 \b, unknown version
  315. >4 byte&0x7f 0 \b
  316. # some common bits/sample values
  317. >>20 beshort&0x1f0 0x030 \b, 4 bit
  318. >>20 beshort&0x1f0 0x050 \b, 6 bit
  319. >>20 beshort&0x1f0 0x070 \b, 8 bit
  320. >>20 beshort&0x1f0 0x0b0 \b, 12 bit
  321. >>20 beshort&0x1f0 0x0f0 \b, 16 bit
  322. >>20 beshort&0x1f0 0x170 \b, 24 bit
  323. >>20 byte&0xe 0x0 \b, mono
  324. >>20 byte&0xe 0x2 \b, stereo
  325. >>20 byte&0xe 0x4 \b, 3 channels
  326. >>20 byte&0xe 0x6 \b, 4 channels
  327. >>20 byte&0xe 0x8 \b, 5 channels
  328. >>20 byte&0xe 0xa \b, 6 channels
  329. >>20 byte&0xe 0xc \b, 7 channels
  330. >>20 byte&0xe 0xe \b, 8 channels
  331. # some common sample rates
  332. >>17 belong&0xfffff0 0x0ac440 \b, 44.1 kHz
  333. >>17 belong&0xfffff0 0x0bb800 \b, 48 kHz
  334. >>17 belong&0xfffff0 0x07d000 \b, 32 kHz
  335. >>17 belong&0xfffff0 0x056220 \b, 22.05 kHz
  336. >>17 belong&0xfffff0 0x05dc00 \b, 24 kHz
  337. >>17 belong&0xfffff0 0x03e800 \b, 16 kHz
  338. >>17 belong&0xfffff0 0x02b110 \b, 11.025 kHz
  339. >>17 belong&0xfffff0 0x02ee00 \b, 12 kHz
  340. >>17 belong&0xfffff0 0x01f400 \b, 8 kHz
  341. >>17 belong&0xfffff0 0x177000 \b, 96 kHz
  342. >>17 belong&0xfffff0 0x0fa000 \b, 64 kHz
  343. >>21 byte&0xf >0 \b, >4G samples
  344. >>21 byte&0xf 0 \b
  345. >>>22 belong >0 \b, %u samples
  346. >>>22 belong 0 \b, length unknown
  347. # (ISDN) VBOX voice message file (Wolfram Kleff)
  348. 0 string VBOX VBOX voice message data
  349. # ReBorn Song Files (.rbs)
  350. # David J. Singer <doc@deadvirgins.org.uk>
  351. 8 string RB40 RBS Song file
  352. >29 string ReBorn created by ReBorn
  353. >37 string Propellerhead created by ReBirth
  354. # Synthesizer Generator and Kimwitu share their file format
  355. 0 string A#S#C#S#S#L#V#3 Synthesizer Generator or Kimwitu data
  356. # Kimwitu++ uses a slightly different magic
  357. 0 string A#S#C#S#S#L#HUB Kimwitu++ data
  358. # From "Simon Hosie
  359. 0 string TFMX-SONG TFMX module sound data
  360. # From danny.milo@gmx.net (Danny Milosavljevic)
  361. # monkeysaudio for magic.mime
  362. 0 string MAC\ X/Monkey audio,
  363. >4 leshort >0 version %d,
  364. >6 leshort >0 compression level %d,
  365. >8 leshort >0 flags %x,
  366. >10 leshort >0 channels %d,
  367. >12 lelong >0 samplerate %d,
  368. >24 lelong >0 frames %d
  369. # adlib sound files
  370. # From Gürkan Sengün <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu
  371. 0 string RAWADATA RdosPlay RAW
  372. 1068 string RoR AMUSIC Adlib Tracker
  373. 0 string JCH EdLib
  374. 0 string mpu401tr MPU-401 Trakker
  375. 0 string SAdT Surprise! Adlib Tracker
  376. >4 byte x Version %d
  377. 0 string XAD! eXotic ADlib
  378. 0 string ofTAZ! eXtra Simple Music
  379. # Spectrum 128 tunes (.ay files).
  380. # From: Emanuel Haupt <ehaupt@critical.ch>
  381. 0 string ZXAYEMUL Spectrum 128 tune
  382. # From: Alex Beregszaszi <alex@fsn.hu>
  383. 0 string MP+ Musepack
  384. >3 byte&0x0f x SV%d
  385. 0 string \0BONK BONK,
  386. #>5 byte x version %d
  387. >14 byte x %d channel(s),
  388. >15 byte =1 lossless,
  389. >15 byte =0 lossy,
  390. >16 byte x mid-side
  391. 384 string LockStream LockStream Embedded file (mostly MP3 on old Nokia phones)