home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / AFFFAQ.308 < prev    next >
Text File  |  1996-08-02  |  98KB  |  2,278 lines

  1. FAQ: Audio File Formats
  2. =======================
  3.  
  4. Table of contents
  5. -----------------
  6.  
  7. Introduction
  8. Device characteristics
  9. Popular sampling rates
  10. Compression schemes
  11. Current hardware
  12. File formats
  13. File conversions
  14. Playing audio files on UNIX
  15. Playing audio files on micros
  16. The Sound Site Newsletter
  17. Posting sounds
  18.  
  19. Appendices (in part 2):
  20.  
  21. FTP access for non-internet sites
  22. AIFF Format (Audio IFF)
  23. The NeXT/Sun audio file format
  24. IFF/8SVX Format
  25. Playing sound on a PC
  26. The EA-IFF-85 documentation
  27. US Federal Standard 1016 availability
  28. Creative Voice (VOC) file format
  29. RIFF WAVE (.WAV) file format
  30. U-LAW and A-LAW definitions
  31. AVR File Format
  32. The Amiga MOD Format
  33.  
  34.  
  35. Introduction
  36. ------------
  37.  
  38. This is version 3 of this FAQ, which I started in November 1991 under
  39. the name "The audio formats guide".  I bumped the major version number
  40. again at the occasion of the split in two parts: part one is the main
  41. text and part two consists of the collection of appendices.
  42.  
  43. I am posting this about once a fortnight, either unchanged (just to
  44. inform new readers), or updated (if I learn more or when new hardware
  45. or software becomes popular).  I post to alt.binaries.sounds.{misc,d}
  46. and to comp.dsp, for maximal coverage of people interested in audio,
  47. and to {news,comp}.answers, for easy reference.
  48.  
  49. The entire FAQ is also available by anonymous ftp from ftp.cwi.nl
  50. [192.16.184.180], directory pub/audio, files AudioFormats.{part1,part2}.
  51.  
  52. BTW: All FAQs, including this one, are available for anonymous ftp on
  53. the archive site rtfm.mit.edu in directory /pub/usenet/news.answers/.
  54. The name under which a FAQ is archived appears in the "Archive-Name:"
  55. line at the top of the article.  This FAQ is archived as
  56. audio-fmts/part[12].
  57.  
  58. A companion posting with subject "Changes to: ..." is occasionally
  59. posted listing the diffs between a new version and the last.  This is
  60. not reposted, and it is suppressed when the diffs are bigger than the
  61. new version.
  62.  
  63. Send updates, comments and questions to <guido@cwi.nl>.  I'd like to
  64. thank everyone who sent updates in the past.
  65.  
  66. --Guido van Rossum, CWI, Amsterdam <guido@cwi.nl>
  67.  
  68.  
  69. Device characteristics
  70. ----------------------
  71.  
  72. In this text, I will only use the term "sample" to refer to a single
  73. output value from an A/D converter, i.e., a small integer number
  74. (usually 8 or 16 bits).
  75.  
  76. Audio data is characterized by the following parameters, which
  77. correspond to settings of the A/D converter when the data was
  78. recorded.  Naturally, the same settings must be used to play the data.
  79.  
  80. - sampling rate (in samples per second), e.g. 8000 or 44100
  81.  
  82. - number of bits per sample, e.g. 8 or 16
  83.  
  84. - number of channels (1 for mono, 2 for stereo, etc.)
  85.  
  86. Approximate sampling rates are often quoted in Hz or kHz ([kilo-]
  87. Hertz), however, the politically correct term is samples per second
  88. (samples/sec).  Sampling rates are always measured per channel, so for
  89. stereo data recorded at 8000 samples/sec, there are actually 16000
  90. samples in a second.  I will sometimes write 8 k as a shorthand for
  91. 8000 samples/sec.
  92.  
  93. Multi-channel samples are generally interleaved on a frame-by-frame
  94. basis: if there are N channels, the data is a sequence of frames,
  95. where each frame contains N samples, one from each channel.  (Thus,
  96. the sampling rate is really the number of *frames* per second.)  For
  97. stereo, the left channel usually comes first.
  98.  
  99. The specification of the number of bits for U-LAW (pronounced mu-law
  100. -- the u really stands for the Greek letter mu) samples is somewhat
  101. problematic.  These samples are logarithmically encoded in 8 bits,
  102. like a tiny floating point number; however, their dynamic range is
  103. that of 12 bit linear data.  Source for converting to/from U-LAW
  104. (written by Jef Poskanzer) is distributed as part of the SOX package
  105. mentioned below; it can easily be ripped apart to serve in other
  106. applications.  The official definition is the CCITT standard G.711.
  107.  
  108. There exists another encoding similar to U-LAW, called A-LAW, which
  109. is used as a European telephony standard.  There is less support for
  110. it in UNIX workstations.
  111.  
  112. (See the Appendix for some formulae describing U-LAW and A-LAW.)
  113.  
  114.  
  115. Popular sampling rates
  116. ----------------------
  117.  
  118. Some sampling rates are more popular than others, for various reasons.
  119. Some recording hardware is restricted to (approximations of) some of
  120. these rates, some playback hardware has direct support for some.  The
  121. popularity of divisors of common rates can be explained by the
  122. simplicity of clock frequency dividing circuits :-).
  123.  
  124. Samples/sec     Description
  125.  
  126. 5500            One fourth of the Mac sampling rate (rarely seen).
  127.  
  128. 7333            One third of the Mac sampling rate (rarely seen).
  129.  
  130. 8000            Exactly 8000 samples/sec is a telephony standard that
  131.                 goes together with U-LAW (and also A-LAW) encoding.
  132.                 Some systems use an slightly different rate; in
  133.                 particular, the NeXT workstation uses 8012.8210513,
  134.                 apparently the rate used by Telco CODECs.
  135.  
  136. 11 k            Either 11025, a quarter of the CD sampling rate,
  137.                 or half the Mac sampling rate (perhaps the most
  138.                 popular rate on the Mac).
  139.  
  140. 16000           Used by, e.g. the G.722 compression standard.
  141.  
  142. 18.9 k          CD-ROM/XA standard.
  143.  
  144. 22 k            Either 22050, half the CD sampling rate, or the Mac
  145.                 rate; the latter is precisely 22254.545454545454 but
  146.                 usually misquoted as 22000.  (Historical note:
  147.                 22254.5454... was the horizontal scan rate of the
  148.                 original 128k Mac.)
  149.  
  150. 32000           Used in digital radio, NICAM (Nearly-Instantaneous
  151.                 Companded Audio Multiplex [IBA/BREMA/BBC]) and other
  152.                 TV work, at least in the UK; also long play DAT and
  153.                 Japanese HDTV.
  154.  
  155. 37.8 k          CD-ROM/XA standard for higher quality.
  156.  
  157. 44056           This weird rate is used by professional audio
  158.                 equipment to fit an integral number of samples in a
  159.                 video frame.
  160.  
  161. 44100           The CD sampling rate.  (DAT players recording
  162.                 digitally from CD also use this rate.)
  163.  
  164. 48000           The DAT (Digital Audio Tape) sampling rate for
  165.                 domestic use.
  166.  
  167. Files samples on SoundBlaster hardware have sampling rates that are
  168. divisors of 1000000.
  169.  
  170. While professinal musicians disagree, most people don't have a problem
  171. if recorded sound is played at a slightly different rate, say, 1-2%.
  172. On the other hand, if recorded data is being fed into a playback
  173. device in real time (say, over a network), even the smallest
  174. difference in sampling rate can frustrate the buffering scheme used...
  175.  
  176. There may be an emerging tendency to standardize on only a few
  177. sampling rates and encoding styles, even if the file formats may
  178. differ.  The suggested rates and styles are:
  179.  
  180.     rate (samp/sec) style mono/stereo
  181.  
  182.     8000 8-bit U-LAW mono
  183.     22050 8-bit linear unsigned mono and stereo
  184.     44100 16-bit linear signed mono and stereo
  185.  
  186.  
  187. Compression schemes
  188. -------------------
  189.  
  190. Strange though it seems, audio data is remarkably hard to compress
  191. effectively.  For 8-bit data, a Huffman encoding of the deltas between
  192. successive samples is relatively successful.  For 16-bit data,
  193. companies like Sony and Philips have spent millions to develop
  194. proprietary schemes.  Information about PASC (Philips' scheme) can be
  195. found in Advanced Digital Audio by Ken C. Pohlmann.
  196.  
  197. Public standards for voice compression are slowly gaining popularity,
  198. e.g. CCITT G.721 (ADPCM at 32 kbits/sec) and G.723 (ADPCM at 24 and 40
  199. kbits/sec).  (ADPCM == Adaptive Delta Pulse Code Modulation.)  Sun
  200. Microsoft has placed the source code of a portable implementation of
  201. these algorithms (as well as G.711, which defines A-LAW and U-LAW) in
  202. the public domain (needless to say, their proprietary implementation
  203. distributed in binary form with Solaris is better :-).  One place to
  204. ftp this source code from is ftp.cwi.nl:/pub/audio/ccitt-adpcm.tar.Z.
  205. Source for another 32 kbits/sec ADPCM implementation, assumed to be
  206. compatible with Intel's DVI audio format, can be ftp'ed from
  207. ftp.cwi.nl:/pub/audio/adpcm.shar.  (** NOTE: if you are using v1.0,
  208. you should get v1.1, released 17-Dec-1992, which fixes a serious bug
  209. -- the quality of v1.1 is claimed to be better than U-LAW **)
  210.  
  211. GSM 06.10 is a speech encoding in use in Europe that compresses 160
  212. 13-bit samples into 260 bits (or 33 bytes), i.e. 1650 bytes/sec (at
  213. 8000 samples/sec).  A free implementation can be ftp'ed from
  214. tub.cs.tu-berlin.de, file /pub/tubmik/gsm-1.0.tar.Z.
  215.  
  216. There are also two US federal standards, 1016 (Code excited linear
  217. prediction (CELP), 4800 bits/s) and 1015 (LPC-10E, 2400 bits/s).  See
  218. also the appendix for 1016.
  219.  
  220. Tony Robinson <ajr@eng.cam.ac.uk> has written a good FAST loss-less
  221. compression for lots of different audio formats (particularly good for
  222. WAV and MOD files).  The software is available by anonymous ftp from
  223. svr-ftp.eng.cam.ac.uk [129.169.24.20], directory misc, file
  224. shorten-1.08.tar.Z.
  225.  
  226. (Note that U-LAW and silence detection can also be considered
  227. compression schemes.)
  228.  
  229. Here's a note about audio codings by Van Jacobson <van@ee.lbl.gov>:
  230. Several people used the words "LPC" and "CELP" interchangably.  They
  231. are very different.  An LPC (Linear Predictive Coding) coder fits
  232. speech to a simple, analytic model of the vocal tract, then throws
  233. away the speech & ships the parameters of the best-fit model.  An LPC
  234. decoder uses those parameters to generate synthetic speech that is
  235. usually more-or-less similar to the original.  The result is
  236. intelligible but sounds like a machine is talking.  A CELP (Code
  237. Excited Linear Predictor) coder does the same LPC modeling but then
  238. computes the errors between the original speech & the synthetic model
  239. and transmits both model parameters and a very compressed
  240. representation of the errors (the compressed representation is an
  241. index into a 'code book' shared between coders & decoders -- this is
  242. why it's called "Code Excited").  A CELP coder does much more work
  243. than an LPC coder (usually about an order of magnitude more) but the
  244. result is much higher quality speech: The FIPS-1016 CELP we're working
  245. on is essentially the same quality as the 32Kb/s ADPCM coder but uses
  246. only 4.8Kb/s (the same as the LPC coder).
  247.  
  248. The comp.compression FAQ has some text on the 6:1 audio compression
  249. scheme used by MPEG (a video compression standard-to-be).  It's
  250. interesting to note that video compression reaches much higher ratios
  251. (like 26:1).  This FAQ is ftp'able from rtfm.mit.edu [18.72.1.58] in
  252. directory /pub/usenet/news.answers/compression-faq, files part1 and
  253. part2.
  254.  
  255. Comp.compression also carries a regular posting "How to uncompress
  256. anything" by David Lemson <lemson@uiuc.edu>, which (tersely) hints on
  257. which program you need to uncompress a file whose name ends in .<foo>
  258. for almost any conceivable <foo>.  Ftp'able from ftp.cso.uiuc.edu
  259. (128.174.5.59) in the directory /doc/pcnet as the file compression.
  260.  
  261. Documentation on a digital cellular telephone system by Qualcomm Inc.
  262. can be ftp'ed from ftp.qualcomm.com:/pub/cdma; the vocoder is in
  263. appendix A.
  264.  
  265. Apple has an Audio Compression/Expansion scheme called ACE (on the GS)
  266. / MACE (on the Macintosh).  It's a lossy scheme that attempts to
  267. predict where the wave will go on the next sample. There's very little
  268. quality change on 8:4 compression, somewhat more for 8:3.  It does
  269. guarantee exactly 50% or 62.5% compression, though.  I believe MACE
  270. uses larger ratios/more loss, but I'm unsure of the specific numbers.
  271. (Marc Sira)
  272.  
  273.  
  274. Current hardware
  275. ----------------
  276.  
  277. I am aware of the following computer systems that can play back and
  278. (sometimes) record audio data, with their characteristics.  Note that
  279. for most systems you can also buy "professional" sampling hardware,
  280. which supports much better quality, e.g. >= 44.1 k 16 bits stereo.
  281. The characteristics listed here are a rough estimate of the
  282. capabilities of the basic hardware only (and even here I am on thin
  283. ice, with systems becoming ever more powerful).
  284.  
  285. machine             bits            max sampling rate    #output channels
  286.  
  287. Mac (all types)     8               22k                  1
  288. Mac (newer ones)    16              64k                  4(128)
  289. Apple IIgs          8               32k / >70k           16(st)
  290. PC/soundblaster pro 8               ?/(22k st, 44.1k mo) 1(st)
  291. PC/soundblaster 16  16              44.1k                1(st)
  292. PC/pas              8               44.1k st, 88.2k mo   1(st)
  293. PC/pas-16           16              44.1k st, 88.2k mo   1(st)
  294. PC/turtle beach multisound 16       44.1k                1(st)
  295. PC/cards with aria chipset 16       44.1k                1(st)
  296. PC/roland rap-10    16              44.1k                1(st)
  297. PC/gravis ultrasound 8/16           44.1k                14-32(st)
  298. Atari ST            8               22k                  1
  299. Atari STE,TT        8               50k                  2
  300. Atari Falcon 030    16              50k                  8(st)
  301. Amiga               8               varies above 29k     4(st)
  302. Sun Sparc           U-LAW           8k                   1
  303. Sun Sparcst. 10     U-LAW,8,16      48k                  1(st)
  304. NeXT                U-LAW,8,16      44.1k                1(st)
  305. SGI Indigo          8,16            48k                  4(st)
  306. SGI Indigo2,Indy    8,16            48k                  16(st,4-channel)
  307. Acorn Archimedes    ~U-LAW          ~180k                8(st)
  308. Sony NWS-3xxx       U,A,8,16        8-37.8k              1(st)
  309. Sony NWS-5xxx       U,A,8,16        8-48k                1(st)
  310. VAXstation 4000     U-LAW           8k                   1
  311. DEC 3000/300-500    U-LAW           8k                   1
  312. DEC 5000/20-25      U-LAW           8k                   1
  313. Tandy 1000/*L*      8               22k                  3
  314. Tandy 2500          8               22k                  3
  315. HP9000/705,710,425e U,A-LAW,16      8k                   1
  316. HP9000/715,725,735  U,A-LAW,16      48k                  1(st)
  317. HP9000/755 option:  U,A-LAW,16      48k                  1(st)
  318. NCD MCX terminal    U,A,8,16        52k                  1(st)
  319.  
  320. 4(st) means "four voices, stereo"; sampling rates xx/yy are
  321. different recording/playback rates; *L* is any type with 'L' in it.
  322.  
  323. All these machines can play back sound without additional hardware,
  324. although the needed software is not always standard; also, some
  325. machines need external hardware to record sound (or to record at
  326. higher quality, like the NeXT, whose built-in sampling hardware only
  327. does 8000 samples/sec in U-LAW).  Please don't send me details on
  328. optional or 3rd party hardware, there is too much and it is really
  329. beyond the scope of this FAQ.  In particular, there is a separate
  330. newsgroup devoted to PC sound cards: comp.sys.ibm.pc.soundcard, which
  331. includes FAQ of its own (also posted to comp.answers and news.answers).
  332.  
  333. The new VAXstation 4000 (VLC and model 60) series lets you PLAY audio
  334. (.au) files, and the package DECsound will let you do the recording.
  335. In fact, DECsound is given away free with Motif 1.1 and supports the
  336. VAXstation, Sun SPARCstation, DECvoice, and DECaudio devices.  Sun
  337. sound files work without change.  The Alpha systems (DEC 3000 Model
  338. 300, 400, 500) also have DECsound bundled with Motif.
  339.  
  340. Notes for the DECstation 5000/20-25: You need either XMedia tools from
  341. DEC ($$$$), or the AudioFile package (which works nicely) from
  342. crl.dec.com (see below). The audio device is "/dev/bba", you cannot
  343. send ".au" files directly to the device, the Xmedia/AF software
  344. provide an "audioserver" which must be run to play/record sounds.
  345.  
  346. The SGI Personal IRIS 4D/30 and 4D/35 have the same capabilities as
  347. the Indigo. The audio board was optional on the 4D/30.
  348. The Indigo2 and Indy features are a superset of the Indigo features.
  349.  
  350. The new Apple Macs have more powerful audio hardware; the latest
  351. models have built-in microphones.
  352.  
  353. Software exists for the PC that can play sound on its 1-bit speaker
  354. using pulse width modulation (see appendix); the Soundblaster board
  355. records at rates up to 13 k and plays back up to 22 k (weird
  356. combination, but that's the way it is).
  357.  
  358. Here's some info about the newest Atari machine, the Falcon030.  This
  359. machine has stereo 16 bit CODECs and a 32 MHz Motorola 56001 that can
  360. handle 8 channels of 16 bit audio, up to 50 khz/channel with
  361. simultaneous playback and record.  The Falcon DMA sound engine is also
  362. compatible with the 8 bit stereo DMA used on the STe and TT. All of
  363. these systems use signed data.
  364.  
  365. On the NeXT, the Motorola 56001 DSP chip is programmable and you can
  366. (in principle) do what you want.  The SGI Indigo uses the same DSP chip but
  367. it can't be programmed by users -- SGI prefers to offer it as a shared
  368. system resource to multiple applications, thus enabling developers to
  369. program audio with their Audio Library and avoid code modifications
  370. for execution on future machines with different audio hardware, i.e. a
  371. different DSP. For example, the Indigo2 and Indy do not have a DSP chip.
  372.  
  373. The Amiga also has a 6-bit volume, which can be used to produce
  374. something like a 14-bit output for each voice.  The hardware can also
  375. use one of each voice-pair to modulate the other in FM (period) or AM
  376. (volume, 6-bits).
  377.  
  378. The Acorn Archimedes uses a variation on U-LAW with the bit order
  379. reversed and the sign bit in bit 0.  Being a 'minority' architecture,
  380. Arc owners are quite adept at converting sound/image formats from
  381. other machines, and it is unlikely that you'll ever encounter sound in
  382. one of the Arc's own formats (there are several).
  383.  
  384. The NCD MCX terminal has audio integrated with its X server.  The
  385. NCDAudio server is an extension of the X server, working together with
  386. it, with stress on the networking capability of sound transmission.
  387. The NCDAudio API provides format handling (ULAW8, Linear Unsig 8,
  388. Linear Sig 8, Linear Sig 16 MSB, Linear Unsig 16 MSB), flowing (to the
  389. server, from the server, to the i/o, from the i/o), wave form
  390. generators (Square, Sine, Saw, Constant) and the capability of area
  391. broadcast using UDP.  Provision for manipulating data files
  392. (SND, WAV, VOC & AU) is also provided.
  393.  
  394. CD-I machines form a special category.  The following formats are used:
  395.  
  396.      - PCM 44.1 kHz standard CD format
  397.      - ADPCM - Addaptive Delta PCM
  398.        - Level A 37.8 kHz 8-bit
  399.        - Level B 37.8 kHz 4-bit
  400.        - Level C 18.9 kHz 4-bit
  401.  
  402.  
  403. File formats
  404. ------------
  405.  
  406. Historically, almost every type of machine used its own file format
  407. for audio data, but some file formats are more generally applicable,
  408. and in general it is possible to define conversions between almost any
  409. pair of file formats -- sometimes losing information, however.
  410.  
  411. File formats are a separate issue from device characteristics.  There
  412. are two types of file formats: self-describing formats, where the
  413. device parameters and encoding are made explicit in some form of
  414. header, and "raw" formats, where the device parameters and encoding
  415. are fixed.
  416.  
  417. Self-describing file formats generally define a family of data
  418. encodings, where a header fields indicates the particular encoding
  419. variant used.  Headerless formats define a single encoding and usually
  420. allows no variation in device parameters (except sometimes sampling
  421. rate, which can be a pain to figure out other than by listening to the
  422. sample).
  423.  
  424. The header of self-describing formats contains the parameters of the
  425. sampling device and sometimes other information (e.g. a
  426. human-readable description of the sound, or a copyright notice).  Most
  427. headers begin with a simple "magic word".  (Some formats do not simply
  428. define a header format, but may contain chunks of data intermingled
  429. with chunks of encoding info.)  The data encoding defines how the
  430. actual samples are stored in the file, e.g. signed or unsigned, as
  431. bytes or short integers, in little-endian or big-endian byte order,
  432. etc.  Strictly spoken, channel interleaving is also part of the
  433. encoding, although so far I have seen little variation in this area.
  434.  
  435. Some file formats apply some kind of compression to the data, e.g.
  436. Huffman encoding, or simple silence deletion.
  437.  
  438. Here's an overview of popular file formats.
  439.  
  440.         Self-describing file formats
  441.         ----------------------------
  442.  
  443. extension, name   origin          variable parameters (fixed; comments)
  444.  
  445. .au or .snd       NeXT, Sun       rate, #channels, encoding, info string
  446. .aif(f), AIFF     Apple, SGI      rate, #channels, sample width, lots of info
  447. .aif(f), AIFC     Apple, SGI      same (extension of AIFF with compression)
  448. .iff, IFF/8SVX    Amiga           rate, #channels, instrument info (8 bits)
  449. .voc              Soundblaster    rate (8 bits/1 ch; can use silence deletion)
  450. .wav, WAVE        Microsoft       rate, #channels, sample width, lots of info
  451. .sf               IRCAM           rate, #channels, encoding, info
  452. none, HCOM        Mac             rate (8 bits/1 ch; uses Huffman compression)
  453. none, MIME        Internet        (see below)
  454. none, NIST SPHERE DARPA speech community (see below)
  455. .mod or .nst      Amiga           (see below)
  456.  
  457. Note that the filename extension ".snd" is ambiguous: it can be either
  458. the self-describing NeXT format or the headerless Mac/PC format, or
  459. even a headerless Amiga format.
  460.  
  461. I know nothing for sure about the origin of HCOM files, only that
  462. there are a lot of them floating around on our system and probably at
  463. FTP sites over the world.  The filenames usually don't have a ".hcom"
  464. extension, but this is what SOX (see below) uses.  The file format
  465. recognized by SOX includes a MacBinary header, where the file
  466. type field is "FSSD".  The data fork begins with the magic word "HCOM"
  467. and contains Huffman compressed data; after decompression it it is 8
  468. bits unsigned data.
  469.  
  470. IFF/8SVX allows for amplitude contours for sounds (attack/decay/etc).
  471. Compression is optional (and extensible); volume is variable; author,
  472. notes and copyright properties; etc.
  473.  
  474. AIFF, AIFC and WAVE are similar in spirit but allow more freedom in
  475. encoding style (other than 8 bit/sample), amongst others.
  476.  
  477. There are other sound formats in use on Amiga by digitizers and music
  478. programs, such as IFF/SMUS.
  479.  
  480. Appendices describes the NeXT and VOC formats; pointers to more info
  481. about AIFF, AIFC, 8SVX and WAVE (which are too complex to describe
  482. here) are also in appendices.
  483.  
  484. DEC systems (e.g. DECstation 5000) use a variant of the NeXT format
  485. that uses little-endian encoding and has a different magic number
  486. (0x0064732E in little-endian encoding).
  487.  
  488. Standard file formats used in the CD-I world are IFF but on the disc
  489. they're in realtime files.
  490.  
  491. An interesting "interchange format" for audio data is described in the
  492. proposed Internet Standard "MIME", which describes a family of
  493. transport encodings and structuring devices for electronic mail.  This
  494. is an extensible format, and initially standardizes a type of audio
  495. data dubbed "audio/basic", which is 8-bit U-LAW data sampled at 8000
  496. samples/sec.
  497.  
  498. The "IRCAM" sound file system has now been superseded by the so-called
  499. "BICSF" (for Berkeley/IRCAM/CARL Sound File system) software release.
  500. More recently, there has been an effort at Princeton (Prof. Paul
  501. Lansky) and Stanford (Stephen Travis Pope) to standardize several
  502. extensions to BICSF.  A description of BICSF and the
  503. Princeton/Stanford extensions is available by anonymous ftp from
  504. ftp.cwi.nl [192.16.184.180], in directory /pub/audio/BICSF-info.  This
  505. file contains further ftp pointers to software.
  506.  
  507. A sound file format popular in the DARPA speech community is the NIST
  508. SPHERE standard.  The most recent version of the SPHERE package is
  509. available via anonymous ftp from jaguar.ncsl.nist.gov [129.6.48.157]
  510. in compressed tar form as "sphere-v.tar.Z" (where "v" is the version
  511. code).  The NIST SPHERE header is an object-oriented, 1024-byte
  512. blocked, ASCII structure which is prepended to the waveform data.  The
  513. header is composed of a fixed-format portion followed by an
  514. object-oriented variable portion.  I have placed a short description
  515. of NIST SPHERE on ftp.cwi.nl:/pub/audio/NIST-SPHERE.
  516.  
  517. Finally, a somewhat different but popular format are "MOD" files,
  518. usually with extension ".mod" or ".nst" (they can also have a prefix
  519. of "mod.").  This originated at the Amiga but players now exist for
  520. many platforms.  MOD files are music files containing 2 parts: (1) a
  521. bank of digitized samples; (2) sequencing information describing how
  522. and when to play the samples.  See the appendix "The Amiga MOD Format"
  523. for a description of this file format (and pointers to ftp'able
  524. players and example MOD files).
  525.  
  526.         Headerless file formats
  527.         -----------------------
  528.  
  529. extension       origin          parameters
  530. or name
  531.  
  532. .snd, .fssd     Mac, PC         variable rate, 1 channel, 8 bits unsigned
  533. .ul             US telephony    8 k, 1 channel, 8 bit "U-LAW" encoding
  534. .snd?           Amiga           variable rate, 1 channel, 8 bits signed
  535.  
  536. It is usually easy to distinguish 8-bit signed formats from unsigned
  537. by looking at the beginning of the data with 'od -b <file | head';
  538. since most sounds start with a little bit of silence containing small
  539. amounts of background noise, the signed formats will have an abundance
  540. of bytes with values 0376, 0377, 0, 1, 2, while the unsigned formats
  541. will have 0176, 0177, 0200, 0201, 0202 instead.  (Using "od -c" will
  542. also show any headers that are tacked in front of the file.)
  543.  
  544. The Apple IIgs records raw data in the same format as the Mac, but
  545. uses a 0 byte as a terminator; samples with value 0 are replaced by 1.
  546.  
  547.         Sound formats and the Apple Macintosh
  548.         -------------------------------------
  549.  
  550. (Thanks to Bill Houle, <Bill.Houle@SanDiegoCA.NCR.COM>)
  551.  
  552.                              SOX/DOS   MAC
  553. Sound Format           file ext  type  Mac program to convert to 'snd'
  554. ---------------------- --------  ----  -------------------------------
  555. Mac snd                .snd      sfil  [n/a]
  556. Amiga IFF/8SVX         .iff            AmigaSndConverter, BST
  557. Amiga SoundTracker     .mod      STrk  ModVoicer
  558. Audio IFF              .aiff     AIFF  SoundExtractor, Sample Editor,
  559.                                        UUTool, BST, M5Mac
  560. DSP Designer                     DSPs  SoundHack
  561. IRCAM                  .sf       IRCM  SoundHack
  562. MacMix                           MSND  SoundHack
  563. RIFF WAVE              .wav            SoundExtractor, BST, Balthazar
  564. SoundBlaster           .voc            SoundExtractor, BST
  565. SoundDesigner/AudioMedia         Sd2f  SoundHack
  566. Sound[Edit|Cap|Wave]   .hcom     FSSD  SoundExtractor, SoundEdit,
  567.                                        Wavicle, BST
  568. Sun uLaw/Next .snd     .au/.snd  NxTS  SoundExtractor, SoundHack,
  569.                                        au<->snd, UUTool, BST
  570.  
  571.  
  572. File conversions
  573. ----------------
  574.  
  575.         SOX (UNIX, PC, Amiga)
  576.         ---------------------
  577.  
  578. The most versatile tool for converting between various audio formats
  579. is SOX ("Sound Exchange").  It can read and write various types of
  580. audio files, and optionally applies some special effects (e.g. echo,
  581. channel averaging, or rate conversion).
  582.  
  583. SOX recognizes all filename extensions listed above except ".snd",
  584. which would be ambiguous anyway, and ".wav" (but there's a patch, see
  585. below).  Use type ".au" for NeXT ".snd" files.  Mac and PC ".snd"
  586. files are completely described by these parameters:
  587.  
  588.         -t raw -b -u -r 11000
  589.  
  590. (or -r 22000 or -r 7333 or -r 5500; 11000 seems to be the most common
  591. rate).
  592.  
  593. The source for SOX, version 6, platchlevel 8, was posted to
  594. alt.sources, and should be widely archived.  (Patch 9 was posted later
  595. and incporporates some important .wav fixes.)  To save you the trouble
  596. of hunting it down, it can be gotten by anonymous ftp from
  597. wuarchive.wustl.edu, in the directory usenet/alt.sources/articles,
  598. files 7288.Z through 7295.Z.  (These files are compressed news
  599. articles containing shar files, if you hadn't guessed.)  I am sure
  600. many sites have similar archives, I'm just listing one that I know of
  601. and which carries a lot of this kind of stuff.  (Also see the appendix
  602. if you don't have Internet access.)
  603.  
  604. A compressed tar file containing the same version of SOX is available
  605. by anonymous ftp from ftp.cwi.nl [192.16.184.180], in directory
  606. /pub/audio/sox7.tar.Z.  You may be able to locate a nearer version
  607. using archie!
  608.  
  609. Ports of SOX:
  610.  
  611. - The source as posted should compile on any UNIX and PC system.
  612.  
  613. - A PC version is available by ftp from ftp.cwi.nl (see above) as
  614.   pub/audio/sox5dos.zip; also available from the garbo mail server.
  615.  
  616. - The latest Amiga SOX is available via anonymous ftp to
  617.   wuarchive.wustl.edu, files systems/amiga/audio/utils/amisox*.  (See
  618.   below for a non-SOX solution.)
  619.   The final release of r6 will compile as distributed on the Amiga with
  620.   SAS/C version 6.  Binaries (since many Amiga users do not own
  621.   compilers) will continue to be available for FTP.
  622.  
  623. SOX usage hints:
  624.  
  625. - Often, the filename extension of sound files posted on the net is
  626.   wrong.  Don't give up, try a few other possibilities using the
  627.   "-t <type>" option.  Remember that the most common file type is
  628.   unsigned bytes, which can be indicated with "-t ub".  You'll have to
  629.   guess the proper sampling rate, but often it's 11k or 22k.
  630.  
  631. - In particular, with SOX version 4 (or earlier), you have to
  632.   specify "-t 8svx" for files with an .iff extension.
  633.  
  634. - When converting linear samples to U-LAW using the .au type for the
  635.   output file, you must specify "-U" for the output file, otherwise
  636.   you will end up with a file containing a NeXT/Sun header but linear
  637.   samples -- only the NeXT will play such files correctly.  Also, you
  638.   must explicitly specify an output sampling rate with "-r 8000".
  639.   (This may seem fixed for most cases in version 5, but it is still
  640.   occasionally necessary, so I'm keeping this warning in.)
  641.  
  642.         Sun Sparc
  643.         ---------
  644.  
  645. On Sun Sparcs, starting at SunOS 4.1, a program "raw2audio" is
  646. provided by Sun (in /usr/demo/SOUND -- see below) which takes a raw
  647. U-LAW file and turns it into a ".au" file by prefixing it with an
  648. appropriate header.
  649.  
  650.         NeXT
  651.         ----
  652.  
  653. On NeXTs, you can usually rename .au files to .snd and it'll work like
  654. a charm, but some .au files lack header info that the NeXT needs.
  655. This can be fixed by using sndconvert:
  656.  
  657.         sndconvert -c 1 -f 1 -s 8012.8210513 -o nextfile.snd sunfile.au
  658.  
  659.         SGI Indigo, Indigo2, Indy and Personal IRIS
  660.         -------------------------------------------
  661.  
  662. SGI supports "soundfiler" (in /usr/sbin), a program similar in
  663. spirit to SOX but with a GUI.  Soundfiler plays aiff, aifc, NeXT/Sun
  664. and .wav formats.  It can do conversions between any of these formats
  665. and to and from raw formats including mulaw.  It also does sample rate
  666. conversions.
  667.  
  668. Three shell commands are also provided that give the same functionality:
  669. "sfplay", "sfconvert", and "aifcresample" (all in /usr/sbin).
  670.  
  671.         Amiga
  672.         -----
  673.  
  674. Mike Cramer's SoundZAP can do no effects except rate change and it
  675. only does conversions to IFF, but it is generally much faster than
  676. SOX.  (Ftp'able from the same directory as amisox above.)
  677.  
  678. Newer versions of OmniPlay (see below) will also convert to IFF.
  679.  
  680.         Tandy
  681.         -----
  682.  
  683. The Tandy 1000 uses a (proprietary?) compressed format.  There is a PD
  684. Mac to Tandy conversion program called CONVERT.  Leonard Erickson
  685. <leonard@qiclab.scn.rain.com> writes: There is a WAV driver from Tandy
  686. if people ask.  There also appears to be a program that purports to
  687. convert other formats to Tandy, but I haven't tested this one yet.
  688.  
  689.         Apple Macintosh
  690.         ---------------
  691.  
  692. Bill Houle sent the following list:
  693.  
  694. Popular commercial apps are indicated with a [*].  All other programs
  695. mentioned are shareware/freeware available from SUMEX and the various
  696. mirror sites, or check archie for the nearest FTP location.
  697.  
  698. MAC SOUND CONVERSION PROGRAMS
  699.  
  700. SoundHack [Tom Erbe, tom@mills.edu]
  701.   Can read/write Sound Designer II, Audio IFF, IRCAM, DSP Designer and NeXT 
  702.   .snd (or Sun .au); 8-bit uLaw, 8-bit linear, 32-bit floating point and 16-bit
  703.   linear data encoding.  Can read (but not write) raw data files.  Implements
  704.   soundfile convolution, a phase vocoder, a binaural filter and an amplitude 
  705.   analysis & gain change module.
  706.  
  707. SoundExtractor [Alberto Ricci, FRicci@polito.it]
  708.   Extracts 'snd' resources, AIFF, SoundEdit, VOC, and WAV data from
  709.   practically anything, converting to 'snd' files.
  710.  
  711. Balthazar [Craig Marciniak, AOL:TemplarDev]
  712.   Converts WAV files to 'snd'.
  713.   
  714. Brian's Sound Tool [Brian Scott, bscott@ironbark.ucnv.edu.au]
  715.   Converts 'snd' or SoundEdit to WAV.  Can also convert WAV, VOC, AIFF, Amiga
  716.   8SVX and uLaw to 'snd'.
  717.  
  718. AmigaSndConverter [Povl H. Pederson, eco861771@ecostat.aau.dk]
  719.   Converts Amiga IFF/8SVX to Mac 'snd'.
  720.  
  721. au<->Mac [Victor J. Heinz, vic:wbst128@xerox.com]
  722.   Converts Sun uLaw to Mac 'snd'.
  723.   
  724. ULAW [Rod Kennedy, rod@faceng.anu.edu.au]
  725.   Converts 'snd' to Sun uLaw.
  726.  
  727. UUTool [Bernie Wieser, wieser@acs.ucalgary.ca]
  728.   Primarily a uuencode/decode program, but in true Swiss Army Knife
  729.   fashion can also read/write Sun uLaw, AIFF, and 'snd' files.
  730.  
  731. ModVoicer [Kip Walker, Kip_Walker@mcimail.com]
  732.   Converts Amiga MOD voices into SoundEdit files or 'snd' resources.
  733.  
  734. Music 5 Mac [Simone Bettini, space@maya.dei.unipd.it]
  735.   Primarily a Music Synthesis system, but can also convert between 'snd', AIFF,
  736.   and IBM .DAT(?).
  737.  
  738. See also the section on players -- some players also do conversions.
  739.  
  740.  
  741. Playing audio files on UNIX
  742. ---------------------------
  743.  
  744. The commands needed to play an audio file depend on the file format
  745. and the available hardware and software.  Most systems can only
  746. directly play sound in their native format; use a conversion program
  747. (see above) to play other formats.
  748.  
  749.         Sun Sparcstation running SunOS 4.x
  750.         ----------------------------------
  751.  
  752. Raw U-LAW files can be played using "cat file >/dev/audio".
  753.  
  754. A whole package for dealing with ".au" files is provided by Sun on an
  755. experimental basis, in /usr/demo/SOUND.  You may have to compile the
  756. programs first.  (If you can't find this directory, either you are not
  757. running SunOS 4.1 yet, or your system administrator hasn't installed
  758. it -- go ask him for it, not me!)  The program "play" in this
  759. directory recognizes all files in Sun/NeXT format, but a SS 1 or 2 can
  760. play only those using U-LAW encoding at 8 k -- the SS 10 hardware
  761. plays other encodings, too.
  762.  
  763. If you ca't find "play", you can also cat a ".au" file to /dev/audio,
  764. if it uses U-LAW; the header will sound like a short burst of noise
  765. but the rest of the data will sound OK (really, the only difference in
  766. this case between raw U-LAW and ".au" files is the header; the U-LAW
  767. data is exactly the same).
  768.  
  769. Finally, OpenWindows 3.0 has a full-fledged audio tool.  You can drop
  770. audio file icons into it, edit them, etc.
  771.  
  772.         Sun Sparcstation running Solaris 2.0
  773.         ------------------------------------
  774.  
  775. Under SVR4 (and hence Solaris 2.0), writing to /dev/audio from the
  776. shell is a bad idea, because the device driver will flush its queue as
  777. soon as the file is closed.  Use "audioplay" instead.  The supported
  778. formats and sampling rates are the same as above.
  779.  
  780.         NeXT
  781.         ----
  782.  
  783. On NeXT machines, the standard "sndplay" program can play all NeXT
  784. format files (this include Sun ".au" files).  It supports at least
  785. U-LAW at 8 k and 16 bits samples at 22 or 44.1 k.  It attempts
  786. on-the-fly conversions for other formats.
  787.  
  788. Sound files are also played if you double-click on them in the file
  789. browser.
  790.  
  791.         SGI Indigo, Indigo2, Indy and Personal IRIS
  792.         -------------------------------------------
  793.  
  794. On SGI Indigo, Indigo2, Indy and the 4D/30 and /35 Personal IRIS workstations,
  795. "WorkSpace" plays audio files in .aiff, .aifc, .au, and .wav formats if
  796. you double click them and the sampling rate is one of 8000, 11025,
  797. 16000, 22050, 32000, 44100, or 48000.  On the Personal IRIS, you need
  798. to have the audio board installed (check the output from hinv) and you
  799. must run IRIX 3.3.2 or 4.0 or higher.  These files can also be played
  800. with "soundfiler" and "sfplay".  ".aiff" and ".aifc" files at the above
  801. sampling rates can also be played with playaifc.  (All in /usr/sbin)
  802.  
  803. There is no simple /dev/audio interface on these SGI machines.  (There
  804. was one on 4D/25 machines, reading and writing signed linear 8-bit
  805. samples at rates of 8, 16 and 32 k.)
  806.  
  807. A program "playulaw" was posted as part of the "radio 2.0" release
  808. that I posted to several source groups; it plays raw U-LAW files on
  809. the Indigo, Indigo2, Indy or Personal IRIS audio hardware.
  810.  
  811.         Sony NEWS
  812.         ---------
  813.  
  814. The whole current Sony NEWS line (laptop, desktop, server) have
  815. builtin sound capabilities.  You can buy an external board for the
  816. older NEWS machines.  In the default mode (8k/8-bit mulaw), Sun .au
  817. files are directly supported (you can 'cat' .au files to /dev/sb0 and
  818. have them play.)  The /usr/sony/bin/sbplay command on NEWS-OS 6.0
  819. also supports Sun .au files.
  820.  
  821.         Others
  822.         ------
  823.  
  824. Most other UNIX boxes don't have audio hardware and thus can't play
  825. audio data.  This is actually rapidly changing and most new hardware
  826. that hits the market has some form of audio support.  Unfortunately
  827. there is no single portable interface for audio that comes near the
  828. acceptance and functionality (let alone code size :-) of X11 for
  829. graphics.  There are at least two network-transparent packages, both
  830. in some way based on the X11 architecture, that attempt to fillo the
  831. gap:
  832.  
  833. DEC CRL's AudioFile supports Digital RISC systems running Ultrix,
  834. Digital Alpha AXP systems running OSF/1, Sun Sparcs, and SGI
  835. AL-capable systems (e.g., Indigo, Indy).  The source kit is located at
  836. ftp site crl.dec.com [192.58.206.2] in /pub/DEC/AF.
  837.  
  838. NCD's NetAudio supports NCD's MCX line of X terminals as well as
  839. Sparcs running either SunOS 4.1.3 or Solaris 2.2, using the /dev/audio
  840. interface (they claim it should be easy to port).  The source it
  841. located at ftp.x.org [198.112.44.100] in contrib/netaudio.  It is also
  842. ported to SGI (tested on IRIX 5.x), and there are unconfirmed rumors
  843. that it is being ported to SCI and Linux.
  844.  
  845.  
  846. Playing audio files on the Vaxstation 4000 (VMS)
  847. ------------------------------------------------
  848.  
  849. 1) Without DECsound
  850.  
  851. ".au" files can be played by COPYING them to device "SOA0:".  This
  852. device is set up by enabling the driver SODRIVER.  You can use the
  853. following command file:
  854.  
  855. $!---------------- cut here -------------------------------
  856. $! sound_setup.com    enable SOUND driver
  857. $ run sys$system:sysgen
  858. connect soa0 /adapter=0 /csr=%x0e00 /vector=%o304 /driver=sodriver
  859. exit
  860. $ exit
  861. $!----------------- cut here ------------------------------------
  862.  
  863. 2) With DECsound (bundled with motif)
  864.  
  865. Just start DECsound by selecting it from the session manager in the 
  866. applications menu. (Not there use "@vue$library:sound$vue_startup").
  867. Make sure settings; device type (vaxstation 4000) and play settings
  868. (headphone jack) are selected.  To play files from the DCL prompt 
  869. (handy if you want to play sounds on a remote workstation) set a 
  870. symbol up as follows; 
  871. PLAY == "$DECSOUND -VOLUME 50 -PLAY"
  872. usage;
  873. DCL> play sound.au
  874.  
  875. 3) Audio port
  876.  
  877. The external audio port comes with a telephone-jack-like port.   For
  878. starters, you can plug a telephone RECEIVER right into this port to
  879. hear your first sound files.   After that, you can use the adapter
  880. (that came with the VaxStation), and plug in a small set of stereo
  881. speakers or headphones (the kind you'd plug into a WALKMAN, for 
  882. example), for more volume.  The adapter also has a microphone plug so
  883. that you can record sounds if DECsound is installed.
  884.  
  885.  
  886. Playing audio files on micros
  887. -----------------------------
  888.  
  889. Most micros have at least a speaker built in, so theoretically all you
  890. need is the right software.  Unfortunately most systems don't come
  891. bundled with sound-playing software, so there are many public domain
  892. or shareware software packages, each with their own bugs and features.
  893. Most separate sound recording hardware also comes with playing
  894. software, most of which can play sound (in the file format used by
  895. that hardware) even on machines that don't have that hardware
  896. installed.
  897.  
  898.         PC or compatible
  899.         ----------------
  900.  
  901. Chris S. Craig announces the following software for PCs:
  902.  
  903. ScopeTrax       This is a complete PC sound player/editor package.  Sounds
  904.                 can be played back at ANY rate between 1kHz to 65kHz through
  905.                 the PC speaker or the Sound Blaster.  It supports several
  906.                 file formats including VOC, IFF/8SVX, raw signed and raw
  907.                 unsigned.  A separate executable is provided to convert
  908.                 .au and mu-law to raw format.  ScopeTrax requires EGA/VGA
  909.                 graphics for editing and displaying sounds on a REALTIME
  910.                 oscilloscope.  The package also includes:
  911.                       * An expanded memory player which can play sounds
  912.                         larger than 640K in size.
  913.                       * Basic (rough) sound compression/uncompression
  914.                         utilities.
  915.                       * Complete documentation.
  916.                 The package is FREEWARE!  It is available on SIMTEL in the
  917.                 PD1:[MSDOS.SOUND] directory.
  918.  
  919. One of the appendices below contains a list of more programs to play
  920. sound on the PC.
  921.  
  922.         Atari
  923.         -----
  924.  
  925. For sounds on Atari STs - programs are in the atari/sound/players
  926. directory on atari.archive.umich.edu (141.211.164.8).
  927.  
  928.         Tandy
  929.         -----
  930.  
  931. On a Tandy 1000, sounds can be played and recorded with DeskMate Sound
  932. (SOUND.PDM), or if they not stored in compressed format, they can also
  933. be played be a program called PLAYSND.  No indication of whether
  934. PLAYSND is PD or not. It hasn't been updated since March of 89.
  935.  
  936.         Amiga
  937.         -----
  938.  
  939. On the Amiga, OmniPlay by David Champion <dgc3@midway.uchicago.edu>
  940. plays and converts IFF-8SVX, AIFF, WAV, VOC, .au, .snd, and 8 bit raw
  941. (signed, unsigned, u-law) samples.  As of version 1.23, OmniPlay will
  942. also convert any playable sample to 8SVX.  Files: wuarchive.wustl.edu
  943. in /systems/amiga/audio/sampleplayers/oplay123.lha (?)
  944. amiga.physik.unizh.ch in mus/play/oplay123.lha
  945.  
  946.         Apple Macintosh
  947.         ---------------
  948.  
  949. Malcolm Slaney from Apple writes:
  950.  
  951.  "We do have tools to play sound back on most of our Unix hosts.  We wrote
  952.  a program called TcpPlay that lets us read a sound file on a Unix host,
  953.  open a TCP/IP connection to the Mac on my desk, and plays the file.  We
  954.  think of it as X windows for sound (at least a step in that direction.)
  955.  
  956.  This software is available for anonymous FTP from ftp.apple.com
  957.  [IP address 130.43.2.3 -- Guido].
  958.  Look for  ~ftp/pub/TcpPlay/TcpPlay.sit.hqx.
  959.  
  960.  Finally, there are MANY tools for working with sound on the Macintosh. Three
  961.  applications that come to mind immediately are SoundEdit (formerly by
  962.  Farralon and now by MacroMind/Paracomp), Alchemy and Eric Keller's Signalyze.
  963.  There are lots of other tools available for sound editing (including some
  964.  of the QuickTime Movie tools.)"
  965.  
  966. Bill Houle sent the following lists:
  967.  
  968. Popular commercial apps are indicated with a [*].  All other programs
  969. mentioned are shareware/freeware available from SUMEX and the various
  970. mirror sites, or check archie for the nearest FTP location.
  971.  
  972. MAC SOUND EDITORS
  973.  
  974. Sample Editor [Garrick McFarlane, McFarlaneGA@Kirk.Vax.Aston.Ac.UK]
  975.   Plays AIFF and 'snd' sounds.  Can convert between AIFF and 'snd'.
  976.   Can record from built-in mic.  Can add effects such as fade,
  977.   normalize, delay, etc.
  978.  
  979. Wavicle [Lee Fyock]
  980.   Plays SoundEdit files.  Can convert to 'snd'.  Can record from built-in mic.
  981.   Can add effects such as fade, filter, reverb, etc.
  982.  
  983. [*]SoundEdit/SoundEdit Pro [Farallon/MacroMind*Paracomp]
  984.   Plays SoundEdit and 'snd' sounds.  Can read/write SoundEdit files and 'snd' 
  985.   sounds.  Can record from built-in mic.  Can add effects such as
  986.   echo, filter, reverb, etc.
  987.  
  988.  
  989. MAC SOUND PLAYERS
  990.  
  991. Sound-Tracker  [Frank Seide]
  992.   Plays Amiga SoundTracker files in foreground or background.
  993.  
  994. Macintosh Tracker [Thomas R. Lawrance, tomlaw@world.std.com]
  995.   Plays Amiga SoundTracker files in foreground or background. A port of Marc
  996.   Espie's Unix Tracker version with Frank Seide's core player thrown in for
  997.   good measure.
  998.  
  999. The Player [Antoine Rosset & Mike Venturi]
  1000.   Plays AIFF, SoundEdit, MOD, and 'snd' files.
  1001.  
  1002. SoundMaster (aka [*]Kaboom!) [Bruce Tomlin]
  1003.   Associates SoundEdit files to MacOS events.
  1004.  
  1005. SndControl [Riccardo Ettore, 72277.1344@compuserve.com]
  1006.   Associates 'snd' sounds to MacOS events.
  1007.  
  1008. Canon 2 [Glenn Anderson, glenn@otago.ac.nz; Jeff Home, jeff@otago.ac.nz]
  1009.   Plays AIFF or 'snd' files in foreground or background.
  1010.  
  1011. Another Mac play/convert program: "It's called SoundApp. I wrote it,
  1012. (franke1@llnl.gov) and it's FreeWare. It will play: SoundCap,
  1013. SoundEdit, WAVE, VOC, MOD, Amiga IFF (8SVX), Sound Designer, AIFF, AU,
  1014. Mac Resource, and DVI ADPCM. It can convert all the above to System 7
  1015. sound resources (except MOD where just the samples are extracted.) And
  1016. it will double buffer."
  1017.  
  1018.  
  1019. The Sound Site Newsletter
  1020. -------------------------
  1021.  
  1022. An electronic publication with lots of info about digitised sound and
  1023. sound formats, albeit mostly on PCs, is "The Sound Site Newsletter",
  1024. maintained by David Komatsu <davek@uhunix.uhcc.hawaii.edu>.
  1025. Issue 14 appeared in July 1993.  As of that issue, the Sound Site
  1026. Newsletter has expanded its charter to include commercial products and
  1027. will appear monthly.  There is now also a sound site network of ftp
  1028. servers, bulletin boards and authors.  The Sound Site Newsletter (once
  1029. again!) has its own ftp site: sound.usach.cl.
  1030.  
  1031. The Sound Newsletter is posted to: comp.sys.ibm.pc.soundcard
  1032.                                    comp.sys.ibm.pc.misc
  1033.                                    rec.games.misc
  1034. FTP: oak.oakland.edu (misc/sound)
  1035.      garbo.uwasa.fi (pc/sound)
  1036.      sound.usach.cl (pub/Sound/Newsltr) [Home Base]
  1037.  
  1038.  
  1039. Posting sounds
  1040. --------------
  1041.  
  1042. The newsgroup alt.binaries.sounds.misc is dedicated to postings
  1043. containing sound.  (Discussions related to such postings belong in
  1044. alt.binaries.sounds.d.)
  1045.  
  1046. There is no set standard for posting sounds; uuencoded files in most
  1047. popular formats are welcome, if split in parts under 50 kBytes.  To
  1048. accomodate automatic decoding software (such as the ":decode" command
  1049. of the nn newsreader), please place a part indicator of the form
  1050. (mm/nn) at the end of your subject meaning this is number mm of a
  1051. total of nn part.
  1052.  
  1053. It is recommended to post sounds in the format that was used for the
  1054. original recording; conversions to other formats often lose
  1055. information and would do people with identical hardware as the poster
  1056. no favor.  For instance, convering 8-bit linear sound to U-LAW loses
  1057. the lower few bits of the data, and rate changing conversions almost
  1058. always add noise.  Converting from U-LAW to linear requires expansion
  1059. to 16 bit samples if no information loss is allowed!
  1060.  
  1061. U-LAW data is best posted with a NeXT/Sun header.
  1062.  
  1063. If you have to post a file in a headerless format (usually 8-bit
  1064. linear, like ".snd"), please add a description giving at least the
  1065. sampling rate and whether the bytes are signed (zero at 0) or unsigned
  1066. (zero at 0200).  However, it is highly recommended to add a header
  1067. that indicates the sampling rate and encoding scheme; if necessary you
  1068. can use SOX to add a header of your choice to raw data.
  1069.  
  1070. Compression of sound files usually isn't worth it; the standard
  1071. "compress" algorithm doesn't save much when applied to sound data
  1072. (typically at most 10-20 percent), and compression algorithms
  1073. specifically designed for sound (e.g. NeXT's) are usually
  1074. proprietary.  (See also the section "Compression schemes" earlier.)
  1075.  
  1076. From guido@cwi.nl Mon Apr 25 16:27:24 1994
  1077. Newsgroups: alt.binaries.sounds.misc,alt.binaries.sounds.d,comp.dsp,alt.answers,comp.answers,news.answers
  1078. From: guido@cwi.nl (Guido van Rossum)
  1079. Subject: FAQ: Audio File Formats (part 2 of 2)
  1080. Followup-To: alt.binaries.sounds.d,comp.dsp
  1081. Supersedes: <audio-part2_761913666@charon.cwi.nl>
  1082. Nntp-Posting-Host: voorn.cwi.nl
  1083. Reply-To: guido@cwi.nl
  1084. Organization: CWI, Amsterdam
  1085. Date: Mon, 25 Apr 1994 08:17:19 GMT
  1086.  
  1087. Archive-name: audio-fmts/part2
  1088. Submitted-by: Guido van Rossum <guido@cwi.nl>
  1089. Version: 3.05
  1090. Last-modified: 27-Sep-1993
  1091.  
  1092. Appendices
  1093. ==========
  1094.  
  1095. Here are some more detailed pieces of info that I received by e-mail.
  1096. They are reproduced here virtually without much editing.
  1097.  
  1098. Table of contents
  1099. -----------------
  1100.  
  1101. FTP access for non-internet sites
  1102. AIFF Format (Audio IFF)
  1103. The NeXT/Sun audio file format
  1104. IFF/8SVX Format
  1105. Playing sound on a PC
  1106. The EA-IFF-85 documentation
  1107. US Federal Standard 1016 availability
  1108. Creative Voice (VOC) file format
  1109. RIFF WAVE (.WAV) file format
  1110. U-LAW and A-LAW definitions
  1111. AVR File Format
  1112. The Amiga MOD Format
  1113.  
  1114. ------------------------------------------------------------------------
  1115. FTP access for non-internet sites
  1116. ---------------------------------
  1117.  
  1118. >From the sci.space FAQ:
  1119.  
  1120.     Sites not connected to the Internet cannot use FTP directly, but
  1121.     there are a few automated FTP servers which operate via email.
  1122.     Send mail containing only the word HELP to ftpmail@decwrl.dec.com
  1123.     or bitftp@pucc.princeton.edu, and the servers will send you
  1124.     instructions on how to make requests.  (The bitftp service is no
  1125.     longer available through UUCP gateways due to complaints about
  1126.     overuse :-( )
  1127.  
  1128. Also:
  1129.  
  1130.     FAQ lists are available by anonymous FTP from rftm.mit.edu
  1131.     and by email from mail-server@rtfm.mit.edu (send a message
  1132.     containing "help" for instructions about the mail server).
  1133.  
  1134.  
  1135. ------------------------------------------------------------------------
  1136. AIFF Format (Audio IFF) and AIFC
  1137. --------------------------------
  1138.  
  1139. This format was developed by Apple for storing high-quality sampled
  1140. sound and musical instrument info; it is also used by SGI and several
  1141. professional audio packages (sorry, I know no names).  An extension,
  1142. called AIFC or AIFF-C, supports compression (see the last item below).
  1143.  
  1144. I've made a BinHex'ed MacWrite version of the AIFF spec (no idea if
  1145. it's the same text as mentioned below) available by anonymous ftp from
  1146. ftp.cwi.nl [192.16.184.180]; the file is /pub/audio/AudioIFF1.2.hqx.
  1147. A newer version is also available: /pub/audio/AudioIFF1.3.hqx.
  1148. But you may be better off with the AIFF-C specs, see below.
  1149.  
  1150. Mike Brindley (brindley@ece.orst.edu) writes:
  1151.  
  1152. "The complete AIFF spec by Steve Milne, Matt Deatherage (Apple) is
  1153. available in 'AMIGA ROM Kernal Reference Manual: Devices (3rd Edition)'
  1154. 1991 by Commodore-Amiga, Inc.; Addison-Wesley Publishing Co.; 
  1155. ISBN 0-201-56775-X, starting on page 435 (this edition has a charcoal
  1156. grey cover).  It is available in most bookstores, and soon in many
  1157. good librairies."
  1158.  
  1159. According to Mark Callow (msc@sgi.com):
  1160.  
  1161. A PostScript version of the AIFF-C specification is available via
  1162. anonymous ftp on FTP.SGI.COM (192.48.153.1) as /sgi/aiff-c.9.26.91.ps.
  1163.  
  1164. Benjamin Denckla <bdenckla@husc.harvard.edu> writes:
  1165.  
  1166. A piece of information that may be of some use to people who want to use
  1167. AIFF files with their Macintosh Think C programs:  AIFF data structures are
  1168. contained in the file AIFF.h in the "Apple #Includes" folder that comes
  1169. on the distribution disks.  I found this out a little too late: I had
  1170. already coded my own structures.  I assume that this header file comes
  1171. with Apple programming products like MPW [C|C++] as well.
  1172.  
  1173. An important file format for the Mac which is only mentioned once in the
  1174. FAQ is the Sound Designer II file format.  There is also an older Sound
  1175. Designer I format.  I have the SDII format in electronic form but I don't
  1176. think I'm at liberty to distribute it.  It can be obtained by applying to
  1177. become a 3rd Party Developer for Digidesign.  This process is simple
  1178. (1-page application) and free.  Call Digidesign at 415-688-0600 for
  1179. information.  The SDII file format is interesting in that all non-sample
  1180. data (sample rate, channels, etc.) is contained in the resource fork and
  1181. the data fork contains sample data only.
  1182.  
  1183. ------------------------------------------------------------------------
  1184. The NeXT/Sun audio file format
  1185. ------------------------------
  1186.  
  1187. Here's the complete story on the file format, from the NeXT
  1188. documentation.  (Note that the "magic" number is ((int)0x2e736e64),
  1189. which equals ".snd".)  Also, at the end, I've added a litte document
  1190. that someone posted to the net a couple of years ago, that describes
  1191. the format in a bit-by-bit fashion rather than from C.
  1192.  
  1193. I received this from Doug Keislar, NeXT Computer.  This is also the
  1194. Sun format, except that Sun doesn't recognize as many format codes.  I
  1195. added the numeric codes to the table of formats and sorted it.
  1196.  
  1197.  
  1198. SNDSoundStruct:  How a NeXT Computer Represents Sound
  1199.  
  1200. The NeXT sound software defines the SNDSoundStruct structure to  
  1201. represent sound.  This structure defines the soundfile and Mach-O  
  1202. sound segment formats and the sound pasteboard type.  It's also used  
  1203. to describe sounds in Interface Builder.  In addition, each instance  
  1204. of the Sound Kit's Sound class encapsulates a SNDSoundStruct and  
  1205. provides methods to access and modify its attributes.
  1206.  
  1207. Basic sound operations, such as playing, recording, and cut-and-paste  
  1208. editing, are most easily performed by a Sound object.  In many cases,  
  1209. the Sound Kit obviates the need for in-depth understanding of the  
  1210. SNDSoundStruct architecture.  For example, if you simply want to  
  1211. incorporate sound effects into an application, or to provide a simple  
  1212. graphic sound editor (such as the one in the Mail application), you  
  1213. needn't be aware of the details of the SNDSoundStruct.  However, if  
  1214. you want to closely examine or manipulate sound data you should be  
  1215. familiar with this structure.
  1216.  
  1217. The SNDSoundStruct contains a header, information that describes the  
  1218. attributes of a sound, followed by the data (usually samples) that  
  1219. represents the sound.  The structure is defined (in  
  1220. sound/soundstruct.h) as:
  1221.  
  1222. typedef struct {
  1223.     int magic;               /* magic number SND_MAGIC */
  1224.     int dataLocation;        /* offset or pointer to the data */
  1225.     int dataSize;            /* number of bytes of data */
  1226.     int dataFormat;          /* the data format code */
  1227.     int samplingRate;        /* the sampling rate */
  1228.     int channelCount;        /* the number of channels */
  1229.     char info[4];            /* optional text information */
  1230. } SNDSoundStruct;
  1231.  
  1232.  
  1233.  
  1234.  
  1235. SNDSoundStruct Fields
  1236.  
  1237.  
  1238.  
  1239. magic
  1240.  
  1241. magic is a magic number that's used to identify the structure as a  
  1242. SNDSoundStruct.  Keep in mind that the structure also defines the  
  1243. soundfile and Mach-O sound segment formats, so the magic number is  
  1244. also used to identify these entities as containing a sound.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250. dataLocation
  1251.  
  1252. It was mentioned above that the SNDSoundStruct contains a header  
  1253. followed by sound data.  In reality, the structure only contains the  
  1254. header; the data itself is external to, although usually contiguous  
  1255. with, the structure.  (Nonetheless, it's often useful to speak of the  
  1256. SNDSoundStruct as the header and the data.)  dataLocation is used to  
  1257. point to the data.  Usually, this value is an offset (in bytes) from  
  1258. the beginning of the SNDSoundStruct to the first byte of sound data.   
  1259. The data, in this case, immediately follows the structure, so  
  1260. dataLocation can also be thought of as the size of the structure's  
  1261. header.  The other use of dataLocation, as an address that locates  
  1262. data that isn't contiguous with the structure, is described in  
  1263. "Format Codes," below.
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269. dataSize, dataFormat, samplingRate, and channelCount
  1270.  
  1271. These fields describe the sound data.
  1272.  
  1273. dataSize is its size in bytes (not including the size of the  
  1274. SNDSoundStruct).
  1275.  
  1276. dataFormat is a code that identifies the type of sound.  For sampled  
  1277. sounds, this is the quantization format.  However, the data can also  
  1278. be instructions for synthesizing a sound on the DSP.  The codes are  
  1279. listed and explained in "Format Codes," below.
  1280.  
  1281. samplingRate is the sampling rate (if the data is samples).  Three  
  1282. sampling rates, represented as integer constants, are supported by  
  1283. the hardware:
  1284.  
  1285. Constant        Sampling Rate (samples/sec) 
  1286.  
  1287. SND_RATE_CODEC  8012.821        (CODEC input)
  1288. SND_RATE_LOW    22050.0 (low sampling rate output)
  1289. SND_RATE_HIGH   44100.0 (high sampling rate output)
  1290.  
  1291. channelCount is the number of channels of sampled sound.
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297. info
  1298.  
  1299. info is a NULL-terminated string that you can supply to provide a  
  1300. textual description of the sound.  The size of the info field is set  
  1301. when the structure is created and thereafter can't be enlarged.  It's  
  1302. at least four bytes long (even if it's unused).
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308. Format Codes
  1309.  
  1310. A sound's format is represented as a positive 32-bit integer.  NeXT  
  1311. reserves the integers 0 through 255; you can define your own format  
  1312. and represent it with an integer greater than 255.  Most of the  
  1313. formats defined by NeXT describe the amplitude quantization of  
  1314. sampled sound data:
  1315.  
  1316. Value   Code    Format 
  1317.  
  1318. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  1319. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  1320. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  1321. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  1322. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  1323. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  1324. 6       SND_FORMAT_FLOAT        floating-point samples
  1325. 7       SND_FORMAT_DOUBLE       double-precision float samples
  1326. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  1327. 9       SND_FORMAT_NESTED       ?
  1328. 10      SND_FORMAT_DSP_CORE     DSP program
  1329. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  1330. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  1331. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  1332. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  1333. 15      ?
  1334. 16      SND_FORMAT_DISPLAY      non-audio display data
  1335. 17      SND_FORMAT_MULAW_SQUELCH        ?
  1336. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  1337. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  1338. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  1339. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  1340. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  1341. [Some new ones supported by Sun.  This is all I currently know. --GvR]
  1342. 23      SND_FORMAT_ADPCM_G721
  1343. 24      SND_FORMAT_ADPCM_G722
  1344. 25      SND_FORMAT_ADPCM_G723_3
  1345. 26      SND_FORMAT_ADPCM_G723_5
  1346. 27      SND_FORMAT_ALAW_8
  1347.  
  1348.  
  1349. Most formats identify different sizes and types of  
  1350. sampled data.  Some deserve special note:  
  1351.  
  1352.  
  1353. --      SND_FORMAT_DSP_CORE format contains data that represents a  
  1354. loadable DSP core program.  Sounds in this format are required by the  
  1355. SNDBootDSP() and SNDRunDSP() functions.  You create a  
  1356. SND_FORMAT_DSP_CORE sound by reading a DSP load file (extension  
  1357. ".lod") with the SNDReadDSPfile() function.
  1358.  
  1359. --      SND_FORMAT_DSP_COMMANDS is used to distinguish sounds that  
  1360. contain DSP commands created by the Music Kit.  Sounds in this format  
  1361. can only be created through the Music Kit's Orchestra class, but can  
  1362. be played back through the SNDStartPlaying() function.
  1363.  
  1364. --      SND_FORMAT_DISPLAY format is used by the Sound Kit's  
  1365. SoundView class.  Such sounds can't be played.  
  1366.  
  1367.  
  1368. --      SND_FORMAT_INDIRECT indicates data that has become  
  1369. fragmented, as described in a separate section, below.  
  1370.  
  1371.  
  1372. --      SND_FORMAT_UNSPECIFIED is used for unrecognized formats.
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378. Fragmented Sound Data
  1379.  
  1380. Sound data is usually stored in a contiguous block of memory.   
  1381. However, when sampled sound data is edited (such that a portion of  
  1382. the sound is deleted or a portion inserted), the data may become  
  1383. discontiguous, or fragmented.  Each fragment of data is given its own  
  1384. SNDSoundStruct header; thus, each fragment becomes a separate  
  1385. SNDSoundStruct structure.  The addresses of these new structures are  
  1386. collected into a contiguous, NULL-terminated block; the dataLocation  
  1387. field of the original SNDSoundStruct is set to the address of this  
  1388. block, while the original format, sampling rate, and channel count  
  1389. are copied into the new SNDSoundStructs.  
  1390.  
  1391.  
  1392. Fragmentation serves one purpose:  It avoids the high cost of moving  
  1393. data when the sound is edited.  Playback of a fragmented sound is  
  1394. transparent-you never need to know whether the sound is fragmented  
  1395. before playing it.  However, playback of a heavily fragmented sound  
  1396. is less efficient than that of a contiguous sound.  The  
  1397. SNDCompactSamples() C function can be used to compact fragmented  
  1398. sound data.
  1399.  
  1400. Sampled sound data is naturally unfragmented.  A sound that's freshly  
  1401. recorded or retrieved from a soundfile, the Mach-O segment, or the  
  1402. pasteboard won't be fragmented.  Keep in mind that only sampled data  
  1403. can become fragmented.
  1404.  
  1405.  
  1406.  
  1407. _________________________
  1408. >From mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps Wed Apr  4  
  1409. 23:56:23 EST 1990
  1410. Article 5779 of comp.sys.next:
  1411. Path: mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps
  1412. >From: eps@toaster.SFSU.EDU (Eric P. Scott)
  1413. Newsgroups: comp.sys.next
  1414. Subject: Re: Format of NeXT sndfile headers?
  1415. Message-ID: <445@toaster.SFSU.EDU>
  1416. Date: 31 Mar 90 21:36:17 GMT
  1417. References: <14978@phoenix.Princeton.EDU>
  1418. Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
  1419. Organization: San Francisco State University
  1420. Lines: 42
  1421.  
  1422. In article <14978@phoenix.Princeton.EDU>
  1423.         bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
  1424. >I'd like to take a program I have that converts Macintosh sound  
  1425. files
  1426. >to NeXT sndfiles and polish it up a bit to go the other direction as
  1427. >well.
  1428.  
  1429. Two people have already submitted programs that do this
  1430. (Christopher Lane and Robert Hood); check the various
  1431. NeXT archive sites.
  1432.  
  1433. >       Could someone please give me the format of a NeXT sndfile
  1434. >header?
  1435.  
  1436. "big-endian"
  1437.         0       1       2       3
  1438.         +-------+-------+-------+-------+
  1439. 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  1440.         +-------+-------+-------+-------+
  1441. 4       |                               |       data location
  1442.         +-------+-------+-------+-------+
  1443. 8       |                               |       data size
  1444.         +-------+-------+-------+-------+
  1445. 12      |                               |       data format (enum)
  1446.         +-------+-------+-------+-------+
  1447. 16      |                               |       sampling rate (int)
  1448.         +-------+-------+-------+-------+
  1449. 20      |                               |       channel count
  1450.         +-------+-------+-------+-------+
  1451. 24      |       |       |       |       |       (optional) info  
  1452. string
  1453.  
  1454. 28 = minimum value for data location
  1455.  
  1456. data format values can be found in /usr/include/sound/soundstruct.h
  1457.  
  1458. Most common combinations:
  1459.  
  1460.          sampling  channel    data
  1461.              rate    count  format              
  1462. voice file   8012        1       1 =  8-bit mu-law
  1463. system beep 22050        2       3 = 16-bit linear
  1464. CD-quality  44100        2       3 = 16-bit linear
  1465.  
  1466. ------------------------------------------------------------------------
  1467. IFF/8SVX Format
  1468. ---------------
  1469.  
  1470. Newsgroups: alt.binaries.sounds.d,alt.sex.sounds
  1471. Subject: Format of the IFF header (Amiga sounds)
  1472. Message-ID: <2509@tardis.Tymnet.COM>
  1473. From: jms@tardis.Tymnet.COM (Joe Smith)
  1474. Date: 23 Oct 91 23:54:38 GMT
  1475. Followup-To: alt.binaries.sounds.d
  1476. Organization: BT North America (Tymnet)
  1477.  
  1478. The first 12 bytes of an IFF file are used to distinguish between an Amiga
  1479. picture (FORM-ILBM), an Amiga sound sample (FORM-8SVX), or other file
  1480. conforming to the IFF specification.  The middle 4 bytes is the count of
  1481. bytes that follow the "FORM" and byte count longwords.  (Numbers are stored
  1482. in M68000 form, high order byte first.)
  1483.  
  1484.                 ------------------------------------------
  1485.  
  1486. FutureSound audio file, 15000 samples at 10.000KHz, file is 15048 bytes long.
  1487.  
  1488. 0000: 464F524D 00003AC0 38535658 56484452    FORM..:.8SVXVHDR
  1489.       F O R M     15040 8 S V X  V H D R
  1490. 0010: 00000014 00003A98 00000000 00000000    ......:.........
  1491.             20    15000        0        0
  1492. 0020: 27100100 00010000 424F4459 00003A98    '.......BODY..:.
  1493.      10000 1 0    1.0   B O D Y     15000
  1494.  
  1495. 0000000..03 = "FORM", identifies this as an IFF format file.
  1496. FORM+00..03 (ULONG) = number of bytes that follow.  (Unsigned long int.)
  1497. FORM+03..07 = "8SVX", identifies this as an 8-bit sampled voice.
  1498.  
  1499. ????+00..03 = "VHDR", Voice8Header, describes the parameters for the BODY.
  1500. VHDR+00..03 (ULONG) = number of bytes to follow. 
  1501. VHDR+04..07 (ULONG) = samples in the high octave 1-shot part.
  1502. VHDR+08..0B (ULONG) = samples in the high octave repeat part.
  1503. VHDR+0C..0F (ULONG) = samples per cycle in high octave (if repeating), else 0.
  1504. VHDR+10..11 (UWORD) = samples per second.  (Unsigned 16-bit quantity.)
  1505. VHDR+12     (UBYTE) = number of octaves of waveforms in sample.
  1506. VHDR+13     (UBYTE) = data compression (0=none, 1=Fibonacci-delta encoding).
  1507. VHDR+14..17 (FIXED) = volume.  (The number 65536 means 1.0 or full volume.)
  1508.  
  1509. ????+00..03 = "BODY", identifies the start of the audio data.
  1510. BODY+00..03 (ULONG) = number of bytes to follow.
  1511. BODY+04..NNNNN      = Data, signed bytes, from -128 to +127.
  1512.  
  1513. 0030: 04030201 02030303 04050605 05060605
  1514. 0040: 06080806 07060505 04020202 01FF0000
  1515. 0050: 00000000 FF00FFFF FFFEFDFD FDFEFFFF
  1516. 0060: FDFDFF00 00FFFFFF 00000000 00FFFF00
  1517. 0070: 00000000 00FF0000 00FFFEFF 00000000
  1518. 0080: 00010000 000101FF FF0000FE FEFFFFFE
  1519. 0090: FDFDFEFD FDFFFFFC FDFEFDFD FEFFFEFE
  1520. 00A0: FFFEFEFE FEFEFEFF FFFFFEFF 00FFFF01
  1521.  
  1522. This small section of the audio sample shows the number ranging from -5 (0xFD)
  1523. to +8 (0x08).  Warning: Do not assume that the BODY starts 48 bytes into the
  1524. file.  In addition to "VHDR", chunks labeled "NAME", "AUTH", "ANNO", or 
  1525. "(c) " may be present, and may be in any order.  You will have to check the
  1526. byte count in each chunk to determine how many bytes to skip.
  1527.  
  1528. ------------------------------------------------------------------------
  1529. Playing sound on a PC
  1530. ---------------------
  1531.  
  1532. From: Eric A Rasmussen
  1533.  
  1534. Any turbo PC (8088 at 8 Mhz or greater)/286/386/486/etc. can produce a quality
  1535. playback of single channel 8 bit sounds on the internal (1 bit, 1 channel)
  1536. speaker by utilizing Pulse-Width-Modulation, which toggles the speaker faster
  1537. than it can physically move to simulate positions between fully on and fully
  1538. off.  There are several PD programs of this nature that I know of:
  1539.  
  1540. REMAC  - Plays MAC format sound files.  Files on the Macintosh, at least the
  1541.          sound files that I've ripped apart, seem to contain 3 parts.  The
  1542.          first two are info like what the file icon looks like and other
  1543.          header type info.  The third part contains the raw sample data, and
  1544.          it is this portion of the file which is saved to a seperate file,
  1545.          often named with the .snd extension by PC users.  Personally, I like
  1546.          to name the files .s1, .s2, .s3, or .s4 to indicate the sampling rate
  1547.          of the file. (-s# is how to specify the playback rate in REMAC.)
  1548.          REMAC provides playback rates of 5550hz, 7333hz, 11 khz, & 22 khz.
  1549. REMAC2 - Same as REMAC, but sounds better on higher speed machines.
  1550. REPLAY - Basically same as REMAC, but for playback of Atari ST sounds. 
  1551.          Apparently, the Atari has two sound formats, one of which sounds like
  1552.          garbage if played by REMAC or REPLAY in the incorrect mode.  The
  1553.          other file format works fine with REMAC and so appears to be 'normal'
  1554.          unsigned 8-bit data.  REPLAY provides playback rates of 11.5 khz,
  1555.          12.5 khz, 14 khz, 16 khz, 18.5 khz, 22khz, & 27 khz.
  1556.  
  1557. These three programs are all by the same author, Richard E. Zobell who does
  1558. not have an internet mail address to my knowledge, but does have a GEnie email
  1559. address of R.ZOBELL. 
  1560.  
  1561. Additionally, there are various stand-alone demos which use the internal
  1562. speaker, of which there is one called mushroom which plays a 30 second
  1563. advertising jingle for magic mushroom room deoderizers which is pretty
  1564. humerous.  I've used this player to playback samples that I ripped out of the
  1565. commercial game program Mean Streets, which uses something they call RealSound
  1566. (tm) to playback digital samples on the internal speaker. (Of course, I only do
  1567. this on my own system, and since I own the game, I see no problems with it.)
  1568.  
  1569. For owners of 8 Mhz 286's and above, the option to play 4 channel 8 bit sounds
  1570. (with decent quality) on the internal speaker is also a reality.  Quite a
  1571. number of PD programs exist to do this, including, but not limited to:
  1572.  
  1573. ModEdit, ModPlay, ScreamTracker, STM, Star Trekker, Tetra, and probably a few
  1574. more.  
  1575.  
  1576. All these programs basically make use of various sound formats used by the
  1577. Amiga line of computers.  These include .stm files, .mod files
  1578. [a.k.a. mod. files], and .nst files [really the same hing].  Also,
  1579. these programs pretty much all have the option to playback the 
  1580. sound to add-on hardware such as the SoundBlaster card, the Covox series of
  1581. devices, and also to direct the data to either one or two (for stereo)
  1582. parallel ports, which you could attach your own D/A's to.  (From what I have
  1583. seen, the Covox is basically an small amplified speaker with a D/A which plugs
  1584. into the parallel port.  This sounds very similiar to the Disney Sound System
  1585. (DSS) which people have been talking about recently.)  
  1586.  
  1587. ------------------------------------------------------------------------
  1588. The EA-IFF-85 documentation
  1589. ---------------------------
  1590.  
  1591. From: dgc3@midway.uchicago.edu
  1592.  
  1593. As promised, here's an ftp location for the EA-IFF-85 documentation.  It's
  1594. the November 1988 release as revised by Commodore (the last public release),
  1595. with specifications for IFF FORMs for graphics, sound, formatted text, and
  1596. more.  IFF FORMS now exist for other media, including structured drawing, and
  1597. new documentation is now available only from Commodore.
  1598.  
  1599. The documentation is at grind.isca.uiowa.edu [128.255.19.233], in the
  1600. directory /amiga/f1/ff185.  The complete file list is as follows:
  1601.  
  1602. DOCUMENTS.zoo    
  1603. EXAMPLES.zoo     
  1604. EXECUTABLE.zoo   
  1605. INCLUDE.zoo      
  1606. LINKER_INFO.zoo  
  1607. OBJECT.zoo       
  1608. SOURCE.zoo       
  1609. TP_IFF_Specs.zoo 
  1610.  
  1611. All files except DOCUMENTS.zoo are Amiga-specific, but may be used as a basis
  1612. for conversion to other platforms.  Well, I take that tentatively back.  I
  1613. don't know what TP_IFF_Specs.zoo contains, so it might be non-Amiga-specific.
  1614.  
  1615. ------------------------------------------------------------------------
  1616. US Federal Standard 1016 availability
  1617. -------------------------------------
  1618.  
  1619. From: jpcampb@afterlife.ncsc.mil (Joe Campbell)
  1620.  
  1621. The U.S. DoD's Federal-Standard-1016 based 4800 bps code excited linear
  1622. prediction voice coder version 3.2 (CELP 3.2) Fortran and C simulation
  1623. source codes are available for worldwide distribution (on DOS
  1624. diskettes, but configured to compile on Sun SPARC stations) from NTIS
  1625. and DTIC.  Example input and processed speech files are included.  A
  1626. Technical Information Bulletin (TIB), "Details to Assist in
  1627. Implementation of Federal Standard 1016 CELP," and the official
  1628. standard, "Federal Standard 1016, Telecommunications:  Analog to
  1629. Digital Conversion of Radio Voice by 4,800 bit/second Code Excited
  1630. Linear Prediction (CELP)," are also available.
  1631.  
  1632. This is available through the National Technical Information Service:
  1633.  
  1634. NTIS
  1635. U.S. Department of Commerce
  1636. 5285 Port Royal Road
  1637. Springfield, VA  22161
  1638. USA
  1639. (703) 487-4650
  1640.  
  1641. The "AD" ordering number for the CELP software is AD M000 118
  1642. (US$ 90.00) and for the TIB it's AD A256 629 (US$ 17.50).  The LPC-10
  1643. standard, described below, is FIPS Pub 137 (US$ 12.50).  There is a
  1644. $3.00 shipping charge on all U.S. orders.  The telephone number for
  1645. their automated system is 703-487-4650, or 703-487-4600 if you'd prefer
  1646. to talk with a real person.
  1647.  
  1648. (U.S. DoD personnel and contractors can receive the package from the
  1649. Defense Technical Information Center:  DTIC, Building 5, Cameron
  1650. Station, Alexandria, VA 22304-6145.  Their telephone number is
  1651. 703-274-7633.)
  1652.  
  1653. The following articles describe the Federal-Standard-1016 4.8-kbps CELP
  1654. coder (it's unnecessary to read more than one):
  1655.  
  1656. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  1657. "The Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
  1658. Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
  1659.  
  1660. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  1661. "The DoD 4.8 kbps Standard (Proposed Federal Standard 1016),"
  1662. in Advances in Speech Coding, ed. Atal, Cuperman and Gersho,
  1663. Kluwer Academic Publishers, 1991, Chapter 12, p. 121-133.
  1664.  
  1665. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
  1666. Proposed Federal Standard 1016 4800 bps Voice Coder:  CELP," Speech
  1667. Technology Magazine, April/May 1990, p. 58-64.
  1668.  
  1669.  
  1670. The U.S. DoD's Federal-Standard-1015/NATO-STANAG-4198 based 2400 bps
  1671. linear prediction coder (LPC-10) was republished as a Federal
  1672. Information Processing Standards Publication 137 (FIPS Pub 137).
  1673. It is described in:
  1674.  
  1675. Thomas E. Tremain, "The Government Standard Linear Predictive Coding
  1676. Algorithm:  LPC-10," Speech Technology Magazine, April 1982, p. 40-49.
  1677.  
  1678. There is also a section about FS-1015 in the book:
  1679. Panos E. Papamichalis, Practical Approaches to Speech Coding,
  1680. Prentice-Hall, 1987.
  1681.  
  1682. The voicing classifier used in the enhanced LPC-10 (LPC-10e) is described in:
  1683. Campbell, Joseph P., Jr. and T. E. Tremain, "Voiced/Unvoiced Classification
  1684. of Speech with Applications to the U.S. Government LPC-10E Algorithm,"
  1685. Proceedings of the IEEE International Conference on Acoustics, Speech, and
  1686. Signal Processing, 1986, p. 473-6.
  1687.  
  1688. Copies of the official standard
  1689. "Federal Standard 1016, Telecommunications: Analog to Digital Conversion
  1690. of Radio Voice by 4,800 bit/second Code Excited Linear Prediction (CELP)"
  1691. are available for US$ 5.00 each from:
  1692.  
  1693. GSA Federal Supply Service Bureau
  1694. Specification Section, Suite 8100
  1695. 470 E. L'Enfant Place, S.W.
  1696. Washington, DC  20407
  1697. (202)755-0325
  1698.  
  1699. Realtime DSP code for FS-1015 and FS-1016 is sold by:
  1700.  
  1701. John DellaMorte
  1702. DSP Software Engineering
  1703. 165 Middlesex Tpk, Suite 206
  1704. Bedford, MA  01730
  1705. USA
  1706. 1-617-275-3733
  1707. 1-617-275-4323 (fax)
  1708. dspse.bedford@channel1.com
  1709.  
  1710. DSP Software Engineering's FS-1016 code can run on a DSP Research's Tiger 30
  1711. (a PC board with a TMS320C3x and analog interface suited to development work).
  1712.  
  1713. DSP Research                
  1714. 1095 E. Duane Ave.          
  1715. Sunnyvale, CA  94086        
  1716. USA
  1717. (408)773-1042               
  1718. (408)736-3451 (fax)         
  1719.  
  1720. From: cfreese@super.org (Craig F. Reese)
  1721. Newsgroups: comp.speech,comp.dsp,comp.compression.research
  1722. Subject: CELP 3.2a release now available
  1723. Organization: Supercomputing Research Center (Bowie, MD)
  1724. Date: Tue, 3 Aug 1993 14:55:25 GMT
  1725.  
  1726. 3 August 1993
  1727.  
  1728. CELP 3.2a Release
  1729.  
  1730. Dear CELPers,
  1731.  
  1732. We have placed an updated version of the FS-1016 CELP 3.2 code in the
  1733. anonymous FTP area on super.org (192.31.192.1).  It's in:
  1734.  
  1735.   /pub/celp_3.2a.tar.Z (please be sure to do the ftp in binary mode).
  1736.  
  1737. This is essentially the PC release that was on fumar, except that we
  1738. started directly from the PC disks.  The value added is that we have
  1739. made over 69 corrections and fixes.  Most of these were necessary
  1740. because of the 8 character file name limit on DOS, but there are some
  1741. others, as well.
  1742.  
  1743. The code (C, FORTRAN, diskio) all has been built and tested on a Sun4
  1744. under SunOS4.1.3.  If you want to run it somewhere else, then you may
  1745. have to do a bit of work.  (A Solaris 2.x-compatible release is
  1746. planned soon.)
  1747.  
  1748. [One note to PCers.  The files:
  1749. [
  1750. [       cbsearch.F celp.F csub.F mexcite.F psearch.F
  1751. [
  1752. [are meant to be passed through the C preprocessor (cpp).
  1753. [We gather that DOS (or whatever it's called) can't distinguish 
  1754. [the .F from a .f.  Be careful!
  1755.  
  1756. Very limited support is available from the authors (Joe, et al.).
  1757. Please do not send questions or suggestions without first reading the
  1758. documentation (README files, the Technical Information Bulletin, etc.).
  1759. The authors would enjoy hearing from you, but they have limited time
  1760. for support and would like to use it as efficiently as possible.  They
  1761. welcome bug reports, but, again, please read the documentation first.
  1762. All users of FS-1016 CELP software are strongly encouraged to acquire
  1763. the latest release (version 3.2a as of this writing).
  1764.  
  1765. We do not know how long we will be able to leave the software on this
  1766. site, but it should be _at_least_ through 1 October 1993 (if you find
  1767. it missing, please drop me (Craig) a note).  Please try to get the
  1768. software during off hours (8 p.m. - 7 a.m. Eastern Standard time) or
  1769. folks here might complain and we'll have to get rid of the code (if
  1770. that happens, we'll try to pass it on to someone else, who can put it
  1771. on the net).  We would be more than happy for someone to copy it and
  1772. make it available elsewhere.
  1773.  
  1774. Good Luck,
  1775.  
  1776. Craig F. Reese  (cfreese@super.org)
  1777. IDA/Supercomputing Research Center
  1778.  
  1779. Joe Campbell (jpcampb@afterlife.ncsc.mil)
  1780. Department of Defense
  1781.  
  1782. P.S.  Just so you all know, I (Craig) am not actually involved in
  1783. CELP work.  I mainly got with Joe to help make the software available
  1784. on the Internet.  In the course of doing so, I cleaned up much of it,
  1785. but I am not, by any stretch, a CELP expert and will most likely
  1786. be unable to answer any technical questions concerning it. ;^)
  1787.  
  1788. From: tobiasr@monolith.lrmsc.loral.com (Richard Tobias)
  1789.  
  1790. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code and
  1791. information about products using this code using the AT&T DSP32C and
  1792. AT&T DSP3210, contact:
  1793.  
  1794. White Eagle Systems Technology, Inc.
  1795. 1123 Queensbridge Way
  1796. San Jose, CA 95120
  1797. (408) 997-2706
  1798. (408) 997-3584 (fax)
  1799. rjjt@netcom.com
  1800.  
  1801. From: Cole Erskine <cole@analogical.com>
  1802.  
  1803. [paraphrased]
  1804.  
  1805. Analogical Systems has a _real-time_ multirate implementation of U.S.
  1806. Federal Standard 1016 CELP operating at bit rates of 4800, 7200, and
  1807. 9600 bps on a single 27MHz Motorola DSP56001. Source and object code
  1808. is available for a one-time license fee.
  1809.  
  1810. FREE, _real-time_ demonstration software for the Ariel PC-56D is
  1811. available for those who already have such a board by contacting
  1812. Analogical Systems.  The demo software allows you to record and
  1813. playback CELP files to and from the PC's hard disk.
  1814.  
  1815. Analogical Systems
  1816. 2916 Ramona Street
  1817. Palo Alto, CA 94306
  1818. Tel: +1 (415) 323-3232
  1819. FAX: +1 (415) 323-4222
  1820.  
  1821. ------------------------------------------------------------------------
  1822. Creative Voice (VOC) file format
  1823. --------------------------------
  1824.  
  1825. From: galt@dsd.es.com
  1826.  
  1827. (byte numbers are hex!)
  1828.  
  1829.     HEADER (bytes 00-19)
  1830.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  1831.  
  1832. - ---------------------------------------------------------------
  1833.  
  1834. HEADER:
  1835. =======
  1836.      byte #     Description
  1837.      ------     ------------------------------------------
  1838.      00-12      "Creative Voice File"
  1839.      13         1A (eof to abort printing of file)
  1840.      14-15      Offset of first datablock in .voc file (std 1A 00
  1841.                 in Intel Notation)
  1842.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  1843.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  1844.  
  1845. - ---------------------------------------------------------------
  1846.  
  1847. DATA BLOCK:
  1848. ===========
  1849.  
  1850.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  1851.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  1852.  
  1853.       TYPE   Description     Size (3-byte int)   Info
  1854.       ----   -----------     -----------------   -----------------------
  1855.       00     Terminator      (NONE)              (NONE)
  1856.       01     Sound data      2+length of data    *
  1857.       02     Sound continue  length of data      Voice Data
  1858.       03     Silence         3                   **
  1859.       04     Marker          2                   Marker# (2 bytes)
  1860.       05     ASCII           length of string    null terminated string
  1861.       06     Repeat          2                   Count# (2 bytes)
  1862.       07     End repeat      0                   (NONE)
  1863.       08     Extended        4                   ***
  1864.  
  1865.       *Sound Info Format:       **Silence Info Format:
  1866.        ---------------------      ----------------------------
  1867.        00   Sample Rate           00-01  Length of silence - 1
  1868.        01   Compression Type      02     Sample Rate
  1869.        02+  Voice Data
  1870.  
  1871.     ***Extended Info Format:
  1872.        ---------------------
  1873.        00-01  Time Constant: Mono: 65536 - (256000000/sample_rate)
  1874.                              Stereo: 65536 - (25600000/(2*sample_rate))
  1875.        02     Pack
  1876.        03     Mode: 0 = mono
  1877.                     1 = stereo
  1878.  
  1879.  
  1880.   Marker#           -- Driver keeps the most recent marker in a status byte
  1881.   Count#            -- Number of repetitions + 1
  1882.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  1883.                          or FFFF for endless repetitions
  1884.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  1885.   Length of silence -- in units of sampling cycle
  1886.   Compression Type  -- of voice data
  1887.                          8-bits    = 0
  1888.                          4-bits    = 1
  1889.                          2.6-bits  = 2
  1890.                          2-bits    = 3
  1891.                          Multi DAC = 3+(# of channels) [interesting--
  1892.                                        this isn't in the developer's manual]
  1893.  
  1894. ------------------------------------------------------------------------
  1895. RIFF WAVE (.WAV) file format
  1896. ----------------------------
  1897.  
  1898. RIFF is a format by Microsoft and IBM which is similar in spirit and
  1899. functionality as EA-IFF-85, but not compatible (and it's in
  1900. little-endian byte order, of course :-).  WAVE is RIFF's equivalent of
  1901. AIFF, and its inclusion in Microsoft Windows 3.1 has suddenly made it
  1902. important to know about.
  1903.  
  1904. Rob Ryan was kind enough to send me a description of the RIFF format.
  1905. Unfortunately, it is too big to include here (27 k), but I've made it
  1906. available for anonymous ftp as ftp.cwi.nl:/pub/audio/RIFF-format.
  1907.  
  1908. And here's a pointer to the official description from Matt Saettler,
  1909. Microsoft Multimedia:
  1910.  
  1911. "The complete definition of the WAVE file format as defined by
  1912. IBM/Microsoft is available for anon. FTP from ftp.uu.net in the
  1913. vendor/microsoft/multimedia directory."
  1914.  
  1915. (Rob Ryan's version may actually be an extract from one of the files
  1916. stored there.)
  1917.  
  1918. ------------------------------------------------------------------------
  1919. U-LAW and A-LAW definitions
  1920. ---------------------------
  1921.  
  1922. [Adapted from information provided by duggan@cc.gatech.edu (Rick
  1923. Duggan) and davep@zenobia.phys.unsw.EDU.AU (David Perry)]
  1924.  
  1925. u-LAW (really mu-LAW) is
  1926.  
  1927.           sgn(m)   (     |m |)       |m |
  1928.    y=    ------- ln( 1+ u|--|)       |--| =< 1
  1929.          ln(1+u)   (     |mp|)       |mp|         
  1930.  
  1931. A-LAW is
  1932.  
  1933.      |     A    (m )                 |m |    1
  1934.      |  ------- (--)                 |--| =< - 
  1935.      |  1+ln A  (mp)                 |mp|    A     
  1936.    y=|
  1937.      | sgn(m) (        |m |)    1    |m |
  1938.      | ------ ( 1+ ln A|--|)    - =< |--| =< 1
  1939.      | 1+ln A (        |mp|)    A    |mp|         
  1940.  
  1941. Values of u=100 and 255, A=87.6, mp is the Peak message value, m is
  1942. the current quantised message value.  (The formulae get simpler if you
  1943. substitute x for m/mp and sgn(x) for sgn(m); then -1 <= x <= 1.)
  1944.  
  1945. Converting from u-LAW to A-LAW is in a sense "lossy" since there are
  1946. quantizing errors introduced in the conversion.
  1947.  
  1948. "..the u-LAW used in North America and Japan, and the
  1949. A-LAW used in Europe and the rest of the world and
  1950. international routes.."
  1951.  
  1952. References:
  1953.  
  1954. Modern Digital and Analog Communication Systems, B.P.Lathi., 2nd ed.
  1955. ISBN 0-03-027933-X
  1956.  
  1957. Transmission Systems for Communications
  1958. Fifth Edition
  1959. by Members of the Technical Staff at Bell Telephone Laboratories
  1960. Bell Telephone Laboratories, Incorporated
  1961. Copyright 1959, 1964, 1970, 1982
  1962.  
  1963. A note on the resolution of U-LAW by Frank Klemm <pfk@rz.uni-jena.de>:
  1964.  
  1965. 8 bit U-LAW has the same lowest  magnitude like 12 bit linear and 12 bit
  1966. U-LAW like 16 linear.
  1967.  
  1968. Device/Coding   Resolution              Resolution
  1969.                 on maximal level        on low level
  1970.  8 bit linear    8                       8
  1971.  8 bit ulaw      6                      12      (used for digital telephone)
  1972. 12 bit linear   12                      12
  1973. 12 bit ulaw     10                      16      (used in DAT/Longplay)
  1974. 16 bit linear   16                      16
  1975.  
  1976. estimated for some analoge technique:
  1977. tape recorder (HiFi DIN)
  1978.                  8                       9      (no Problem today)
  1979. tape recorder (semiprofessional)
  1980.                 10.5                    13.5 
  1981.  
  1982. ------------------------------------------------------------------------
  1983. AVR File Format
  1984. ---------------
  1985.  
  1986. From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu)
  1987.  
  1988. A lot of PD software exists to play Mac .snd files on the ST. One other
  1989. format that seems pretty popular (used by a number of commercial packages)
  1990. is the AVR format (from Audio Visual Research). This format has a 128 byte
  1991. header that looks like this:
  1992.  
  1993.         char magic[4]="2BIT";
  1994.         char name[8];           /* null-padded sample name */
  1995.         short mono;             /* 0 = mono, 0xffff = stereo */
  1996.         short rez;              /* 8 = 8 bit, 16 = 16 bit */
  1997.         short sign;             /* 0 = unsigned, 0xffff = signed */
  1998.         short loop;             /* 0 = no loop, 0xffff = looping sample */
  1999.         short midi;             /* 0xffff = no MIDI note assigned,
  2000.                                    0xffXX = single key note assignment
  2001.                                    0xLLHH = key split, low/hi note */
  2002.         long rate;              /* sample frequency in hertz */
  2003.         long size;              /* sample length in bytes or words (see rez) */
  2004.         long lbeg;              /* offset to start of loop in bytes or words.
  2005.                                    set to zero if unused. */
  2006.         long lend;              /* offset to end of loop in bytes or words.
  2007.                                    set to sample length if unused. */
  2008.         short res1;             /* Reserved, MIDI keyboard split */
  2009.         short res2;             /* Reserved, sample compression */
  2010.         short res3;             /* Reserved */
  2011.         char ext[20];           /* Additional filename space, used
  2012.                                    if (name[7] != 0) */
  2013.         char user[64];          /* User defined. Typically ASCII message. */
  2014.  
  2015. -----------------------------------------------------------------------
  2016. The Amiga MOD Format
  2017. --------------------
  2018.  
  2019. From: norlin@mailhost.ecn.uoknor.edu (Norman Lin)
  2020.  
  2021. MOD files are music files containing 2 parts:
  2022.  
  2023. (1) a bank of digitized samples
  2024. (2) sequencing information describing how and when to play the samples
  2025.  
  2026. MOD files originated on the Amiga, but because of their flexibility
  2027. and the extremely large number of MOD files available, MOD players
  2028. are now available for a variety of machines (IBM PC, Mac, Sparc
  2029. Station, etc.)
  2030.  
  2031. The samples in a MOD file are raw, 8 bit, signed, headerless, linear
  2032. digital data.  There may be up to 31 distinct samples in a MOD file,
  2033. each with a length of up to 128K (though most are much smaller; say,
  2034. 10K - 60K).  An older MOD format only allowed for up to 15 samples in
  2035. a MOD file; you don't see many of these anymore.  There is no standard
  2036. sampling rate for these samples.  [But see below.]
  2037.  
  2038. The sequencing information in a MOD file contains 4 tracks of
  2039. information describing which, when, for how long, and at what frequency
  2040. samples should be played.  This means that a MOD file can have up
  2041. to 31 distinct (digitized) instrument sounds, with up to 4 playing
  2042. simultaneously at any given point.  This allows a wide variety
  2043. of orchestrational possibilities, including use of voice samples
  2044. or creation of one's own instruments (with appropriate sampling
  2045. hardware/software).  The ability to use one's own samples as instruments
  2046. is a flexibility that other music files/formats do not share, and
  2047. is one of the reasons MOD files are so popular, numerous, and diverse.
  2048.  
  2049. 15 instrument MODs, as noted above, are somewhat older than 31
  2050. instrument MODs and are not (at least not by me) seen very often
  2051. anymore.  Their format is identical to that of 31 instrument MODs
  2052. except:
  2053.  
  2054. (1) Since there are only 15 samples, the information for the last (15th)
  2055.     sample starts at byte 440 and goes through byte 469.
  2056. (2) The songlength is at byte 470 (contrast with byte 950 in 31 instrument
  2057.     MOD)
  2058. (3) Byte 471 appears to be ignored, but has been observed to be 127.
  2059.     (Sorry, this is from observation only)
  2060. (4) Byte 472 begins the pattern sequence table (contrast with byte 952
  2061.     in a 31 instrument MOD)
  2062. (5) Patterns start at byte 600 (contrast with byte 1084 in 31 instrument MOD)
  2063.  
  2064. "ProTracker," an Amiga MOD file creator/editor, is available for ftp
  2065. everywhere as pt??.lzh.
  2066.  
  2067. From: Apollo Wong <apollo@ee.ualberta.ca>
  2068.  
  2069. From: M.J.H.Cox@bradford.ac.uk (Mark Cox)
  2070. Newsgroups: alt.sb.programmer
  2071. Subject: Re: Format for MOD files...
  2072. Message-ID: <1992Mar18.103608.4061@bradford.ac.uk>
  2073. Date: 18 Mar 92 10:36:08 GMT
  2074. Organization: University of Bradford, UK
  2075.  
  2076. wdc50@DUTS.ccc.amdahl.com (Winthrop D Chan) writes:
  2077. >I'd like to know if anyone has a reference document on the format of the
  2078. >Amiga Sound/NoiseTracker (MOD) files. The author of Modplay said he was going
  2079. >to release such a document sometime last year, but he never did. If anyone
  2080.  
  2081. I found this one, which covers it better than I can explain it - if you
  2082. use this in conjunction with the documentation that comes with Norman
  2083. Lin's Modedit program it should pretty much cover it.
  2084.  
  2085. Mark J Cox
  2086.  
  2087. /***********************************************************************
  2088.  
  2089. Protracker 1.1B Song/Module Format:
  2090. -----------------------------------
  2091.  
  2092. Offset  Bytes  Description
  2093. ------  -----  -----------
  2094.    0     20    Songname. Remember to put trailing null bytes at the end...
  2095.  
  2096. Information for sample 1-31:
  2097.  
  2098. Offset  Bytes  Description
  2099. ------  -----  -----------
  2100.   20     22    Samplename for sample 1. Pad with null bytes.
  2101.   42      2    Samplelength for sample 1. Stored as number of words.
  2102.                Multiply by two to get real sample length in bytes.
  2103.   44      1    Lower four bits are the finetune value, stored as a signed
  2104.                four bit number. The upper four bits are not used, and
  2105.                should be set to zero.
  2106.                Value:  Finetune:
  2107.                  0        0
  2108.                  1       +1
  2109.                  2       +2
  2110.                  3       +3
  2111.                  4       +4
  2112.                  5       +5
  2113.                  6       +6
  2114.                  7       +7
  2115.                  8       -8
  2116.                  9       -7
  2117.                  A       -6
  2118.                  B       -5
  2119.                  C       -4
  2120.                  D       -3
  2121.                  E       -2
  2122.                  F       -1
  2123.  
  2124.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  2125.   46      2    Repeat point for sample 1. Stored as number of words offset
  2126.                from start of sample. Multiply by two to get offset in bytes.
  2127.   48      2    Repeat Length for sample 1. Stored as number of words in
  2128.                loop. Multiply by two to get replen in bytes.
  2129.  
  2130. Information for the next 30 samples starts here. It's just like the info for
  2131. sample 1.
  2132.  
  2133. Offset  Bytes  Description
  2134. ------  -----  -----------
  2135.   50     30    Sample 2...
  2136.   80     30    Sample 3...
  2137.    .
  2138.    .
  2139.    .
  2140.  890     30    Sample 30...
  2141.  920     30    Sample 31...
  2142.  
  2143. Offset  Bytes  Description
  2144. ------  -----  -----------
  2145.  950      1    Songlength. Range is 1-128.
  2146.  951      1    Well... this little byte here is set to 127, so that old
  2147.                trackers will search through all patterns when loading.
  2148.                Noisetracker uses this byte for restart, but we don't.
  2149.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  2150.                tells the tracker what pattern to play at that position.
  2151. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  2152.                inserted when they increased the number of samples from
  2153.                15 to 31. If it's not there, the module/song uses 15 samples
  2154.                or the text has been removed to make the module harder to
  2155.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  2156.  
  2157. Offset  Bytes  Description
  2158. ------  -----  -----------
  2159. 1084    1024   Data for pattern 00.
  2160.    .
  2161.    .
  2162.    .
  2163. xxxx  Number of patterns stored is equal to the highest patternnumber
  2164.       in the song position table (at offset 952-1079).
  2165.  
  2166. Each note is stored as 4 bytes, and all four notes at each position in
  2167. the pattern are stored after each other.
  2168.  
  2169. 00 -  chan1  chan2  chan3  chan4
  2170. 01 -  chan1  chan2  chan3  chan4
  2171. 02 -  chan1  chan2  chan3  chan4
  2172. etc.
  2173.  
  2174. Info for each note:
  2175.  
  2176.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  2177. /                \ /      \  /                \ /      \
  2178. 0000          0000-00000000  0000          0000-00000000
  2179.  
  2180. Upper four    12 bits for    Lower four    Effect command.
  2181. bits of sam-  note period.   bits of sam-
  2182. ple number.                  ple number.
  2183.  
  2184. Periodtable for Tuning 0, Normal
  2185.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  2186.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  2187.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  2188.  
  2189. To determine what note to show, scan through the table until you find
  2190. the same period as the one stored in byte 1-2. Use the index to look
  2191. up in a notenames table.
  2192.  
  2193. This is the data stored in a normal song. A packed song starts with the
  2194. four letters "PACK", but i don't know how the song is packed: You can
  2195. get the source code for the cruncher/decruncher from us if you need it,
  2196. but I don't understand it; I've just ripped it from another tracker...
  2197.  
  2198. In a module, all the samples are stored right after the patterndata.
  2199. To determine where a sample starts and stops, you use the sampleinfo
  2200. structures in the beginning of the file (from offset 20). Take a look
  2201. at the mt_init routine in the playroutine, and you'll see just how it
  2202. is done.
  2203.  
  2204. Lars "ZAP" Hamre/Amiga Freelancers
  2205.  
  2206. ***********************************************************************/
  2207.  
  2208. -- 
  2209. Mark J Cox -----
  2210. Bradford, UK ---
  2211.  
  2212.  
  2213. PS: A file with even *much* more info on MOD files, compiled by Lars
  2214. Hamre, is available from ftp.cwi.nl:/pub/audio/MOD-info.  Enjoy!
  2215.  
  2216.  
  2217. FTP sites for MODs and MOD players
  2218. ----------------------------------
  2219.  
  2220. Subject: MODS AND PLAYERS!! **READ** info/where to get them
  2221. From: cjohnson@tartarus.uwa.edu.au (Christopher Johnson)
  2222. Newsgroups: alt.binaries.sounds.d
  2223. Message-ID: <1h32ivINNglu@uniwa.uwa.edu.au>
  2224. Date: 21 Dec 92 00:19:43 GMT
  2225. Organization: The University of Western Australia
  2226.  
  2227. Hello world,
  2228.  
  2229. For all those asking, here is where to get those mod players and mods.
  2230.  
  2231. SNAKE.MCS.KENT.EDU is the best site for general stuff.  look in /pub/SB-Adlib
  2232.  
  2233. Simtel-20 or archie.au(simtel mirror) in <msdos.sound>
  2234.  
  2235. for windows players ftp.cica.indiana.edu in pub/pc/win3/sound
  2236.  
  2237. here is a short list of players
  2238.  
  2239. mp or modplay   BEST OVERALL                    mp219b.zip      
  2240.         simtel and snake
  2241.  
  2242. wowii           best for vga/fast machines      wowii12b.zip    
  2243.         simtel and snake
  2244.  
  2245. trakblaster     best for compatability          trak-something  
  2246.         simtel and snake        two versions, old one for slow
  2247.         machines
  2248.  
  2249. ss              cute display(hifi)              have_sex.arj
  2250.         found on local BBS (western Australia White Ghost)
  2251.  
  2252. superpro player generally good                  ssp.zip or similar
  2253.         found on night owl 7 CD
  2254.  
  2255. player?         cute display(hifi)              player.zip or similar
  2256.         found on night owl 7 CD
  2257.  
  2258. WINDOWS
  2259.  
  2260. Winmod pro      does protracker                 wmp????.zip
  2261.         cica
  2262.  
  2263. winmod          more stable                     winmod12.zip or similar
  2264.         cica
  2265.  
  2266. Hope this helps, e-mail me if you find any more players and I will add them in for the next time mod player requests get a
  2267. little out of hand.
  2268.  
  2269. for mods ftp to wuarchive.wustl.edu and go to the amiga music directory (pub/amiga/music/ntsb ?????)  that should do you for
  2270. a while
  2271.  
  2272. see you soon
  2273.  
  2274. Chris.
  2275.  
  2276. -----------------------------------------------------------------------
  2277.  
  2278.