home *** CD-ROM | disk | FTP | other *** search
/ gdead.berkeley.edu / gdead.berkeley.edu.tar / gdead.berkeley.edu / pub / gdead / mac / soundmachine.txt < prev    next >
Text File  |  1995-04-15  |  11KB  |  226 lines

  1. SoundMachine 2.1
  2. April 1994
  3. Freeware
  4. Copyright ⌐ Rod Kennedy, 1993-1994.
  5.  
  6. For the Macintosh.
  7.  
  8. Play and record SND/AU (mu-law, A-law, linear) and AIFF/AIFC (MACE3, MACE6) sound
  9. files.   Plethora of buttons during play to change speed, play backwards, loop
  10. sounds, switch formats, etc.  No restriction on file size; playing can take place
  11. in background.
  12. ----------------------------------------------------------------------------
  13. For Impatient New Users:
  14.  
  15. Use Balloon help (you really only need to use it during the learning phase).
  16. ----------------------------------------------------------------------------
  17. Sound Formats Supported (Play and Record):
  18.  
  19. Ñ Ulaw/Mu-law/╡-law: (SND_FORMAT_MULAW_8)
  20. TalkRadio (Geek of the week), or International Telephony format, i.e., 8Khz at 8
  21. bit mono making 64kbits/s (as defined in CCITT G711), or Sun Sparc station
  22. format, or Next format, blah blah.  With SoundMachine you can record in the ╡-law
  23. format at any sample rate from 4kHz up to 22.3kHz (the mac hardware rate, at
  24. least on the older macs).   Stick to the preferred 8kHz rate (default) if
  25. exporting a ╡-law sound to the Sun platform or you haven't got a clue about what
  26. you are doing. 
  27.  
  28. Ñ AIFF/AIFC (none, MACE3 and MACE6 compression supported)
  29. Preferred mac format for big sound sound files; all sound data is in the data
  30. fork (no resource fork information). When playing, SoundMachine hunts for the
  31. sampled data chunk and plays that and ignores things like the  MIDI chunk.  Since
  32. compression schemes such as MACE3 are dynamical in nature (have a state or
  33. memory) then playing such a sound backwards causes sound artefacts.  I rely on
  34. the Sound Manager to expand (convert) in real time rather than do the conversion
  35. manually (whereby I could cleanup the backward playing).  Stereo play supported. 
  36. When recording (mono and 8 bits), the sample rate is the hardware rate of 22.3kHz
  37. but you can select from the three standard compression schemes.   MACE3 is
  38. recommended for the 8 bit mac platform since it outperforms ╡-law which is
  39. memoryless and designed for speech.  
  40.  
  41. Ñ Alaw: (SND_FORMAT_ALAW_8)
  42. This is roughly speaking the European equivalent of ╡-law.  Everything is the
  43. same as for the ╡-law description above (just replace ╡ with A and Bob's your
  44. uncle). Play and record facility.
  45.  
  46. Ñ Linear 8 bit 2's complement: (SND_FORMAT_LINEAR_8)
  47. Just like ╡-law and A-law this is another one of the SND/AU formats. 
  48. SoundMachine supports play and record.  
  49.  
  50. Ñ FSSD non-compressed (play only)
  51. For example, the sound format supplied with Sound Source's Star Trek.  There is a
  52. Huffman endoded FSSD format but I don't have enough info about it yet to support
  53. it.  SoundMachine relies on information in the resource fork to determine the
  54. sample rate.
  55. Data is offset binary 8 bit mono (just like 'snd ' resource format).
  56.  
  57. Ñ Other 8 bit formats (override any header)
  58. You can switch to 2's complement or offset binary representation, ╡-law, A-law to
  59. hear if an unknown sound type is in one of the formats above.
  60. ----------------------------------------------------------------------------
  61. Environment:
  62.  
  63. Needs System 7.  Can use the Speech Manager if present.  Currently requires a
  64. 68020 or better.  I recommend that you use the new Sound Manager 3.0.  Really
  65. needs the Apple Sound Chip or better (AV) to work.
  66. ----------------------------------------------------------------------------
  67. Technical Aspects:
  68.  
  69. Ñ ╡-law recording is generated indirectly and not in real time (however, the
  70. conversion can be put in the background).  SoundMachine records to an
  71. uncompressed AIFF 22.3kHz file; applies an approximate ideal low pass, digital,
  72. antialias filter (approximate delayed truncated sinc impulse response filter)
  73. then linearly interpolates and resamples to the user specified sample rate (which
  74. is twice the cut-off frequency of the low pass filter).  The AIFF linear data is
  75. overwritten by ╡-law converted data and the file is truncated if necessary; and
  76. finally the AIFF header is overwritten with a SND/AU header.]
  77.  
  78. Ñ Uses a custom double buffering technique to play arbitrarily large files
  79. continuously from disk.  It relies on other applications being multitasking
  80. friendly to give a continuous sound output.  SoundMachine does not prime its
  81. buffers at interrupt time.
  82.  
  83. Ñ The size of the buffers it allocates depends on the application memory size;
  84. increase this if you think there is a problem with the quality of the sound
  85. (especially if use use very high sampling rates, e.g., 44.1kHz (CD) or 48.0kHz
  86. (DAT)).  The very minimum application size is 256K and is suitable for most 8kHz
  87. ╡-law sounds.
  88.  
  89. Ñ Be very wary about using the high quality Speech Manager voices as they are
  90. system memory hogs.  If your memory is limited you should consider using Mr
  91. Hughes or Boris (best of the robotic voices) or disabling the voices altogether
  92. using the preferences file.
  93.  
  94. Ñ This is not intended to be a sound format converter (that task is
  95. straightforward but very painful to implement, see "SOX") but rather a player for
  96. the most common (mac-orientated) SAMPLED SOUND sound formats (let's face it,
  97. primarily 8 bit ╡-law).
  98. ----------------------------------------------------------------------------
  99. Controls:
  100.  
  101. Sounds can be fastforwarded; reversed and sped-up; paused and looped.  Clicking 
  102. within the progress bar skips to that portion of the sound.  There are some
  103. keyboard equivalents like:
  104.  Ñ g (go) meaning play
  105.  Ñ p (pause)
  106.  Ñ f (fast forward)
  107.  Ñ b (backwards)
  108.  Ñ <right arrow> next file in queue
  109.  Ñ <left arrow> previous file in queue
  110.  Ñ <down arrow> volume down (unrelated to the control panel setting; A and ╡-law
  111. only)
  112.  Ñ <up arrow> volume up
  113.  Ñ s (stop)
  114.  Ñ l (loop)
  115.  Ñ u (uh?) sound format change
  116.  Ñ i (information) cycle through the information fields
  117.  Ñ command period
  118. If you forget just use balloon help.
  119. ----------------------------------------------------------------------------
  120. Additional Features: 
  121.  
  122. Any number of files (max 100) can be dragged and dropped onto the application
  123. icon and SoundMachine will queue and (try to) play every file.  For help on how
  124. to drive SoundMachine use Balloon Help.  If there is no data in the data fork of
  125. the file, then the file is just skipped (with a warning alert).
  126.  
  127. The preferences are kept in a file called "SoundMachine Prefs" (this is different
  128. from
  129. previous versions of SoundMachine which used "SoundMachine Preferences"; this
  130. older preferences file should be discarded since the data is in a slightly
  131. different format; no harm will come if you don't discard it).
  132. ----------------------------------------------------------------------------
  133. Future Things to do:
  134.  
  135. 1. ADPCM formats.
  136. 2. Sound level display.
  137. 3. 'snd ' resource playing capability.
  138. 4. Play text files using the Speech voice.
  139. 5. 16 bit sound.
  140. 6. Greater than 2 channel (stereo) support.
  141. ----------------------------------------------------------------------------
  142. Bugs:
  143.  
  144. Please report any bugs or info on any other sound format you want supported (no
  145. promises).  With bugs try and describe a precisely as possible the nature of the
  146. problem.  Also forward a binhexed version of the sound file if you think this
  147. might be the problem.
  148. ----------------------------------------------------------------------------
  149. Disclaimer:
  150.  
  151. SoundMachine is freeware.  I retain the copyright, including the right to alter
  152. or sell the program.  You may use and copy SoundMachine freely only on a
  153. non-commercial basis.  SoundMachine cannot be distributed with any commercial
  154. package without my permission.   An exception is that SoundMachine may be
  155. included on any CD ROM provided I get a free copy of that CD ROM (this applies
  156. also to any updates of SoundMachine that are later included on any CD ROM).  You
  157. may not alter or sell this program without my permission.  This ReadMe file must
  158. accompany SoundMachine.
  159. ----------------------------------------------------------------------------
  160. Acknowledgements:
  161.  
  162. Many thanks to a bunch of Northern Hemispherian beta testers.
  163. ----------------------------------------------------------------------------
  164. Obscure Stuff:
  165.  
  166. unsigned char UlawToSnd[] = // x1 (default)
  167. {
  168.   3,  7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
  169.  66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
  170.  98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,
  171. 113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,
  172. 121,121,122,122,122,122,123,123,123,123,124,124,124,124,125,125,
  173. 125,125,125,125,126,126,126,126,126,126,126,126,127,127,127,127,
  174. 127,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,
  175. 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
  176. 253,249,245,241,237,233,229,225,221,217,213,209,205,201,197,193,
  177. 190,188,186,184,182,180,178,176,174,172,170,168,166,164,162,160,
  178. 158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,
  179. 143,142,142,141,141,140,140,139,139,138,138,137,137,136,136,135,
  180. 135,135,134,134,134,134,133,133,133,133,132,132,132,132,131,131,
  181. 131,131,131,131,130,130,130,130,130,130,130,130,129,129,129,129,
  182. 129,129,129,129,129,129,129,129,128,128,128,128,128,128,128,128,
  183. 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128
  184. };
  185.  
  186. This table is actually not the best conversion possible if higher quality sound
  187. is desired.  After conversion of a ╡-law number to a 16 bit linear number,
  188. SoundMachine has a facility to scale this number and extract the any 8 bits (with
  189. saturation) to send to the sound channel (after lookup table conversion).
  190. ----------------------------------------------------------------------------
  191. SND FORMAT ENCODING NUMBERS
  192.  
  193. Currently SoundMachine supports numbers 1, 2 and 27
  194.  
  195. The intention is to support also 3 and 23 to 26; most of the rest are insane.
  196.  
  197. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  198. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  199. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  200. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  201. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  202. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  203. 6       SND_FORMAT_FLOAT        floating-point samples
  204. 7       SND_FORMAT_DOUBLE       double-precision float samples
  205. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  206. 9       SND_FORMAT_NESTED       ?
  207. 10      SND_FORMAT_DSP_CORE     DSP program
  208. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  209. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  210. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  211. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  212. 15      ?
  213. 16      SND_FORMAT_DISPLAY      non-audio display data
  214. 17      SND_FORMAT_MULAW_SQUELCH        ?
  215. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  216. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  217. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  218. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  219. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  220. 23      SND_FORMAT_ADPCM_G721
  221. 24      SND_FORMAT_ADPCM_G722
  222. 25      SND_FORMAT_ADPCM_G723_3
  223. 26      SND_FORMAT_ADPCM_G723_5
  224. 27      SND_FORMAT_ALAW_8
  225.  
  226.