home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / music / sonarc / sonarc.doc < prev    next >
Text File  |  1994-08-05  |  31KB  |  670 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.     SSSSSSS       OOOOO     N         N       A       RRRRRRR        CCCCCC
  11.    S       S     O     O    NN        N      A A      R      RR     C      C
  12.   S         S   O       O   N N       N     A   A     R        R   C        C
  13.   S            O         O  N  N      N    A     A    R        R  C
  14.    SSS         O         O  N   N     N   A       A   R      RR   C
  15.       SSS      O         O  N    N    N  A         A  RRRRRRR     C
  16.          SSS   O         O  N     N   N  AAAAAAAAAAA  R   R       C
  17.             S  O         O  N      N  N  A         A  R    R      C
  18.   S         S   O       O   N       N N  A         A  R     R      C        C
  19.    S       S     O     O    N        NN  A         A  R      R      C      C
  20.     SSSSSSS       OOOOO     N         N  A         A  R       R      CCCCCC
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                 SONARC: Digital Audio Compression, Version 2.1i
  29.                 ───────────────────────────────────────────────
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                      (C) Copyright 1994 Speech Compression
  36.                               All Rights Reserved
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                             U S E R    M A N U A L
  48.  
  49.  
  50.  
  51.                                    June 1994
  52.  
  53. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  i
  54. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  55.  
  56.  
  57.                                    CONTENTS
  58.  
  59.  
  60. INTRODUCTION .......................................................... 1
  61.  
  62. THE UTILITIES ......................................................... 2
  63.  
  64.   SONARC.EXE .......................................................... 2
  65.  
  66.   SONARCX.EXE ......................................................... 5
  67.  
  68. LICENSING INFORMATION ................................................. 6
  69.  
  70. OTHER LICENSABLE MODULES .............................................. 7
  71.  
  72.   SONLIB.DLL .......................................................... 7
  73.  
  74.   LINKABLE OBJECTS .................................................... 9
  75.  
  76. POSTSCRIPT ........................................................... 11
  77.  
  78.  
  79.  
  80.  
  81.                                LEGAL MUMBO-JUMBO
  82.                                       AND
  83.                          ACKNOWLEDGMENT OF TRADEMARKS
  84.  
  85. Even though Speech Compression has tested the Sonarc software and reviewed
  86. the documentation, SPEECH COMPRESSION MAKES NO WARRANTY OR REPRESENTATION,
  87. EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO SONARC SOFTWARE, ITS QUALITY,
  88. PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.  AS A
  89. RESULT, THIS SOFTWARE IS PROVIDED "AS IS", AND YOU, THE USER, ARE ASSUMING
  90. THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE.
  91.  
  92. IN NO EVENT WILL SPEECH COMPRESSION BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
  93. INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN SONARC
  94. SOFTWARE OR ITS DOCUMENTATION, even if advised of the possibility of such
  95. damages.  In particular, Speech Compression shall have no liability for any
  96. programs or data used with Sonarc software, including the cost of recovering
  97. such programs or data.
  98.  
  99.  
  100. Sonarc, Sonarcx and ZipTalk are trademarks of Speech Compression.
  101.  
  102. Microsoft and MS-DOS are registered trademarks and Windows is a trademark of
  103. Microsoft Corporation.
  104.  
  105. BORLAND is a registered trademark of Borland International, Inc.
  106.  
  107. PKZIP is a registered trademark of PKWARE Inc.
  108.  
  109. All other brand and product names mentioned are trademarks or registered
  110. trademarks of their respective holders.
  111.  
  112. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  1
  113. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  114.  
  115.                                  INTRODUCTION
  116.  
  117. Sonarc is a new compression technology specifically optimized for digital
  118. audio.  Think of Sonarc as the PKZIP(r) of digitized audio.  Unlike the older
  119. ADPCM techniques, Sonarc features variable-rate compression which can be
  120. reversed to precisely reconstruct the original, uncompressed signal.  You
  121. don't need to judge its quality by listening to the original and decompressed
  122. versions of the signal; just run MS-DOS's COMP or FC commands!
  123.  
  124. What's the average amount of compression achievable with Sonarc?  Obviously,
  125. truly random sequences of numbers (white noise) will not compress at all
  126. losslessly.  On the other hand, there are 8-bit, 22 KHz sound-effects files
  127. in products on the market today for which Sonarc achieves an average of 3:1
  128. lossless compression (see below).  It all depends upon the quality of the
  129. recording and sampling and on the nature of the audio signal being processed.
  130. The grand average compression of all 8-bit, 11 KHz WAVE and VOC files that
  131. have been processed so far by Sonarc is about 55% (over 2:1).
  132.  
  133. Sonarc was not intended to be a general-purpose data compression utility,
  134. like the other compressors to which it is compared below.  In fact, Sonarc
  135. does only a mediocre job of compression on files which contain non-audio data.
  136. The following comparison is not for the purpose of denigrating the other
  137. compression products, but simply to show how well Sonarc is adapted to the
  138. compression of audio data.  The four files used in this comparison are
  139. probably the most widely distributed audio files in the world, since they
  140. come with each copy of Microsoft's Windows v3.1.
  141.  
  142.     File      Original size     LHA v2.13     PKZIP v2.04g   Sonarc v2.1i
  143. ───────────────────────────────────────────────────────────────────────────
  144.   CHIMES.WAV     15,920           8,680          8,690          4,170
  145.   CHORD.WAV      24,982           9,407          8,861          7,174
  146.   DING.WAV       11,598           4,704          4,630          2,184
  147.   TADA.WAV       27,804          18,388         18,566         11,528
  148.                  ──────          ──────         ──────         ──────
  149.                  80,304          41,179         40,747         25,056
  150.  
  151. The command-line option -ex (Maximum Compression) was used with PKZIP.
  152. Sonarc used the command-line options -o0 and -x for maximum compression.
  153.  
  154. The compressed file sizes reported for LHA and PKZIP are the internal file
  155. sizes and do not include the archive directory overhead.
  156.  
  157. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  2
  158. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  159.  
  160.                                  THE UTILITIES
  161.  
  162. Compression and decompression of audio files are accomplished using the
  163. programs SONARC.EXE and SONARCX.EXE, respectively.
  164.  
  165. Both programs use a simple command-line interface.  Typing SONARC or SONARCX
  166. alone at the DOS prompt will cause the program to display a little "help"
  167. screen, explaining the syntax of the command line parameters.
  168.  
  169. Monaural and stereo, 8-bit and 16-bit files are supported in both WAVE and VOC
  170. formats.  Creative Labs' new v1.20 VOC files are fully supported.
  171.  
  172. Neither utility uses extended or EMS memory.  Both use less than 256K of
  173. conventional memory.
  174.  
  175. Both utilities run on 8086 processors; however, when processing 16-bit data,
  176. they "sense" whether they are executing on a '386 or better, and if so, will
  177. use the '386 instruction set for faster execution.
  178.  
  179. SONARC.EXE (file-to-file compression program)
  180. ───────────────────────────────────────────────────────────────────────────
  181.  
  182. The syntax for invoking SONARC is:
  183.  
  184.         SONARC {-<option>} <input-file> [<output-file>]
  185. or
  186.         SONARC {-<option>} <wildcarded-name> [<dest-path>]
  187.  
  188. If the input file has an extension, then it must be supplied.  If the input
  189. file is not in the current directory, then the path needed to reach it from
  190. the current directory is also required.
  191.  
  192. The output file specification is optional.  If it is omitted, then the output
  193. file will be created in the current directory with a name which is formed by
  194. concatenating the root name in the input file with one of the extensions
  195. shown below.  If it is supplied, then a path can be specified to cause the
  196. output file to be written to a directory other than the current directory.
  197. If no extension is specified for the output file, the extension will be WV,
  198. VC, or SNC, depending on whether the input file is in WAVE, VOC, or another
  199. format, respectively.  (SONARC scans the beginning of the file for a WAVE or
  200. VOC header.  If it finds neither, it assumes the file is "raw", i.e., contains
  201. only audio samples; it then prepends its own header to the output file.)
  202.  
  203. Alternatively, a wild-card specification (with source path, if needed) can be
  204. used.  If a destination path is supplied, the output files will be written to
  205. that path, otherwise to the current directory.  Any destination name or
  206. extension will be ignored.
  207.  
  208. If the input file to Sonarc is a WAVE file, then the output file is also a
  209. WAVE file in a special, proprietary format which has been registered with
  210. Microsoft's Multimedia Product Management.
  211.  
  212. Although the letter options are shown on the next page in upper case, they can
  213. be entered in either upper or lower case.  The option prefix character may be
  214. either a '-' or '/'.
  215.  
  216. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  3
  217. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  218.  
  219. The command-line options for SONARC.EXE are:
  220.  
  221.         Q        quiet mode: no banners, no statistics, no warning for
  222.                  overwriting existing files.
  223.  
  224.         D        delete the input file upon successful operation.
  225.  
  226.         S[n]     assume stereo (two interleaved tracks), or "n" interleaved
  227.                  tracks if the optional number "n" is specified.  The default
  228.                  is to assume that the "raw" file is monaural.
  229.                  (Only obeyed for "raw" files.)
  230.  
  231.         16       assume 16-bit samples.  The default for "raw" files is to
  232.                  assume that they are all 8-bit samples.  Options S and 16 may
  233.                  be used together to compress "raw" 16-bit, stereo files.
  234.                  (Only obeyed for "raw" files.)
  235.  
  236.         Fnum     set the frame size to num in the range 256-4096.  Sonarc
  237.                  divides the source into "frames" of that many samples each.
  238.                  The compressed file then consists of compressed "frames",
  239.                  each of which contains table data specific for that frame.
  240.                  If the frame size is too small, then the size of the table
  241.                  data will not be amortized over enough compressed samples
  242.                  and the compression ratio will suffer.  If the frame size is
  243.                  too big, then spectral changes within the frame will not be
  244.                  tracked accurately enough, and so the compression ratio will
  245.                  suffer for that reason.  Different files will have different
  246.                  "optimal" values for frame size.  This option overrides the
  247.                  default frame size of 2048.
  248.  
  249.         Onum     set order to num in the range from 0 to 30.  "Order" is
  250.                  the number of previous samples to take into consideration
  251.                  when attempting to predict the next sample.  This option
  252.                  fixes the order to the number specified, except that a num
  253.                  of 0 causes the program to "search" for the best value of
  254.                  order for each frame.  This added searching will slow the
  255.                  compression process substantially, but generally yields more
  256.                  compression.  The default order is 10.
  257.  
  258.         X        use floating-point calculations to analyze the signal more
  259.                  thoroughy than is otherwise done.  Setting this option will
  260.                  slow the compression process moderately, or immoderately if
  261.                  combined with the -o0 option described above.  The floating-
  262.                  point code uses Borland's "sensing" library that uses a co-
  263.                  processor if detected at run time.  A co-processor is not
  264.                  necessary, but is highly recommended nevertheless for the
  265.                  sake of compression speed.
  266.  
  267. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  4
  268. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  269.  
  270. Examples:
  271.  
  272.     SONARC C:\WIN31\*.WAV
  273.         Compress all the .WAV files in the C:\WIN31 directory and write the
  274.         output to the current directory
  275.  
  276.     SONARC /D ILBEBACK.WAV ..
  277.         Compress ilbeback.wav in the current directory to ilbeback.wv, in the
  278.         parent directory.  Erase ilbeback.wav if no errors occur.
  279.  
  280.     sonarc -q *.voc d:
  281.         Compress all the .VOC files in the current directory and write the
  282.         corresponding .VC files to the current directory of the D: drive.
  283.         Suppress all screen output.
  284.  
  285.     sonarc piano.sou pno
  286.         (assuming piano.sou is "raw":) Compress piano.sou to pno.snc
  287.  
  288.     sonarc -s piano.sou pno.cmp
  289.         Compress piano.sou to pno.cmp; assume the samples are interleaved
  290.         stereo tracks
  291.  
  292.     sonarc -16 piano.sou pno.
  293.         Compress piano.sou to pno; assume piano.sou is sampled at 16 bits
  294.  
  295.     sonarc -x -o0 g145.wav
  296.         Compress g145.wav for maximum compression ratio, at the expense of
  297.         considerable extra time in compressing the file
  298.  
  299. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  5
  300. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  301.  
  302. SONARCX.EXE (file-to-file decompression program)
  303. ───────────────────────────────────────────────────────────────────────────
  304.  
  305. The syntax for invoking SONARCX is:
  306.  
  307.         SONARCX {-<option>} <input-file> [<output-file>]
  308. or
  309.         SONARCX {-<option>} <wildcarded-name> [<dest-path>]
  310.  
  311. The input (compressed) file specification requires the file's extension, if
  312. any.  (This will be the extension specified for the output file during the
  313. execution of SONARC, or else WV, VC, or SNC, if no extension was specified.)
  314.  
  315. If the input file is not in the current directory, then the path needed to
  316. reach the file from the current directory is also required.
  317.  
  318. The output (decompressed) file specification is optional.  If it is omitted,
  319. then the output file will be created in the current directory with a name
  320. which is formed by concatenating the root name in the input file with one of
  321. extensions described below.  If it is supplied, then a path can be specified
  322. to cause the output file to be written to a directory other than the current
  323. directory.  If no extension is specified for the output file, the extension
  324. will be WAV, VOC, or the original file's extension in the case where the
  325. original file was not in either WAVE or VOC format.
  326.  
  327. Alternatively, a wild-card specification (with source path, if needed) can
  328. be used for specifying the input (compressed) files.  If a destination path
  329. is supplied, then the output (decompressed) files will be written to that
  330. path, otherwise to the current directory.  Any destination name or extension
  331. will be ignored.
  332.  
  333. Since Sonarc is a LOSSLESS compression technology, the decompressed and
  334. original files will differ only in their timestamps.  They will otherwise
  335. compare identically, using the FC or COMP commands in DOS.
  336.  
  337. The command-line options for SONARCX.EXE are:
  338.  
  339.         Q      quiet mode: no banners, no statistics, no warning for 
  340.                overwriting existing files.
  341.  
  342.         D      delete the input file upon successful operation.
  343.  
  344. Examples:
  345.  
  346.     SONARCX *.WV
  347.         Decompress all the .WV files in the current directory and write the
  348.         reconstructed files to the current directory
  349.  
  350.     sonarcx -q *.vc d:\
  351.         Decompress all the .VC files in the current directory and write the
  352.         corresponding .VOC files to the root directory of the D: drive.
  353.         Suppress all screen output.
  354.  
  355.     sonarcx pno.snc piano
  356.         Decompress pno.snc to piano.sou (if "sou" was the extension on the
  357.         original file, stored in the pno.snc file header).
  358.  
  359. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  6
  360. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  361.  
  362.                              LICENSING INFORMATION
  363.  
  364. What you may do with Sonarc depends on what classification you fall under.
  365. The archive referred to is the SNRC21.ZIP file from which this file was
  366. extracted.
  367.  
  368. 1. Shareware distributors, computer clubs and user groups:
  369.  
  370.   Members of this category are permitted to distribute this archive along with
  371.   other shareware programs as long as the charge for the diskette containing
  372.   this archive does not exceed US$10.
  373.  
  374. 2. Bulletin-board services:
  375.  
  376.   You may post this archive freely for the downloading convenience of your
  377.   customers.
  378.   
  379.   You may add a comment to the archive promoting your BBS.  Please inform me
  380.   if you do this.
  381.  
  382.   You may use Sonarc to compress any sound files in your possession and offer
  383.   the Sonarc-compressed files for downloading by your customers as long as
  384.   doing so does not violate any copyrights.  Please inform me if you do this.
  385.  
  386. 3. All other organizations (for-profit, not-for-profit, or governmental):
  387.  
  388.   After an evaluation period not to exceed 120 days, your organization must
  389.   either license the software from Speech Compression or destroy all copies
  390.   in its possession.
  391.  
  392.   For its internal use only, the organization must obtain a Site License.
  393.   For use in distributed products, the organization must obtain a Distribution
  394.   License.  These are available from the contact address below.
  395.  
  396. 4. Individuals (not including fictitious persons, such as corporations):
  397.  
  398.   You may use Sonarc in any way you want for as long as you want, as long as
  399.   it's not-for-profit.  This software is being distributed as shareware, i.e.,
  400.   "try before you buy."
  401.  
  402.   You may make copies of this archive and distribute it freely or upload it
  403.   to BBS's.  You are required to keep the component files of this archive
  404.   together, unmodified.
  405.  
  406.   You are cordially invited to send in a registration fee of $20 if you find
  407.   this software useful.  In exchange, you will receive one free upgrade of the
  408.   next version of Sonarc (v2.2 with a "lossy" algorithm) when it becomes
  409.   available.  You will also get the satisfaction of paying for value received.
  410.  
  411.   Please send your check made out to "Speech Compression", along with your
  412.   name and address (if not already imprinted on the check), to:
  413.  
  414.                              Speech Compression
  415.                              1910 W. Pawnee Lane
  416.                              Colbert, WA  99005-9401
  417.  
  418. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  7
  419. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  420.  
  421.                      OTHER LICENSABLE MODULES: SONLIB.DLL
  422.  
  423. A DLL version of the SONARCX.EXE utility is also available for licensing.
  424. This DLL is useful for applications which install under Windows and use lots
  425. of WAVE files.  It is described in detail below.  It is available for
  426. licensing by contacting Speech Compression at the address on the previous
  427. page.
  428.  
  429. The SONLIB.DLL library has just a single callable function at index 1.  The "C"
  430. calling interface is as follows:
  431.  
  432.     extern int far pascal sonarcx(char* infyl,
  433.                                   char* outfyl,
  434.                                   int   EraseInputFile,
  435.                                   int   ShowNames);
  436.  
  437. or, in Pascal,
  438.  
  439.     function sonarcx(infyl, outfyl: pchar;
  440.                      EraseInputFile,
  441.                      ShowNames: Boolean): integer; far; external;
  442.  
  443. The type "pchar" is a Borland extension to Pascal which is a pointer to a 
  444. C-style, null-terminated string.
  445.  
  446. The first argument, infyl, may be wildcarded, in which case the second 
  447. argument, outfyl, should be the empty string '' or a destination path.  The
  448. third argument, EraseInputFile, has the same effect as the "-D" option in the
  449. SONARCX utility, that is, it causes the input file to be erased after
  450. successful completion.
  451.  
  452. The fourth argument, ShowNames, has the inverse effect of the "-Q" option in
  453. SONARCX.  If false, no screen I/O occurs whatsoever.  If true, however, it
  454. writes the name of the file currently being decompressed in an area of the DLL
  455. caller's active window.
  456.  
  457. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  8
  458. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  459.  
  460.                  OTHER LICENSABLE MODULES: SONLIB.DLL (cont.)
  461.  
  462. The function result is 0 if there were no errors detected.  The following are
  463. the error codes and conditions that may be returned:
  464.  
  465. -17      16-bit file encounted by a DLL configured to process only 8-bits.
  466. -16      .WV file was produced by a later version of Sonarc than v2.1.
  467. -15      specify output file name different from input file name.
  468. -14      bad block type in .VC file.
  469. -13      corrupted VC format file header.
  470. -12      input file is not a Sonarc-compressed file.
  471. -11      input file is an uncompressed VOC file.
  472. -10      internal error: corrupted frame data.
  473.  -9      version mismatch: compressed VOC file is obsolete version.
  474.  -8      unknown chunk type in data list.
  475.  -7      internal error: mismatch in sample count.
  476.  -6      missing "fact" chunk.
  477.  -5      "fact" chunk has corrupted length field.
  478.  -3      WAVE file is already in uncompressed format.
  479.  -2      WAVE file already compressed using another vendorÆs process.
  480.  -1      internal error: bad frame checksum (corrupted frame).
  481.   2      File not found.
  482.   3      Non-existent drive, sub-directory or badly formed file name.
  483.   5      Name is directory or existing read-only file.
  484. 100      Attempt to read past end of file: probably corrupted sound file.
  485. 101      Disk full.
  486. 150      Disk is write-protected.
  487. 152      Drive not ready.
  488. 162      Hardware failure.
  489.  
  490. Other error codes may be returned from DOS for various I/O operations.
  491.  
  492. SONARC version 2.1i    Copyright 1994 Speech Compression              Page  9
  493. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  494.  
  495.                   OTHER LICENSABLE MODULES: LINKABLE OBJECTS
  496.  
  497. There are also assembly-coded buffer-to-buffer compression and decompression
  498. routines available which are highly optimized for both space and speed.  The
  499. interfaces for these routines are described in detail below.
  500.  
  501. Organizations wishing to obtain copies of these linkable modules must contact
  502. Speech Compression at the address on page 6.
  503.  
  504. The "C" declarations for the 8- and 16-bit compression routines are:
  505.  
  506.     typedef unsigned char[max_buf_len]* p_bytary;
  507.  
  508.     extern int far pascal cmp8(p_bytary p_input,
  509.                                int in_size,
  510.                                p_bytary p_output,
  511.                                int out_max,
  512.                                int order);
  513.  
  514.     typedef int[max_buf_len]* p_intary;
  515.  
  516.     extern int far pascal cmp16(p_intary p_input,
  517.                                 int in_size,
  518.                                 p_intary
  519.                                 p_output,
  520.                                 int out_max,
  521.                                 int order);
  522.  
  523. The corresponding Pascal declarations are:
  524.  
  525.     type bytary = array [0..max_buf_len-1] of char;
  526.          p_bytary = ^bytary;
  527.  
  528.     function cmp8(p_input: p_bytary;
  529.                   in_size: integer;
  530.                   p_output: p_bytary;
  531.                   out_max, order: integer;
  532.                  ): integer; far; external;
  533.  
  534.     type intary = array [0..max_buf_len-1] of integer;
  535.          p_intary = ^intary;
  536.  
  537.     function cmp16(p_input: p_intary;
  538.                    in_size: integer;
  539.                    p_output: p_intary;
  540.                    out_max, order: integer;
  541.                   ): integer; far; external;
  542.  
  543. Both cmp8 and cmp16 take a buffer of order+in_size samples at p_input and
  544. compress the in_size samples beginning at p_input[order] into the output buffer
  545. at p_output, not to exceed out_max bytes.  Note that for cmp16, the size of the
  546. input buffer is 2*(order+in_size) bytes, since each sample is 2 bytes. Both
  547. p_input and p_output are far, i.e., 32-bit, segmented pointers.  The argument
  548. out_max is the size of the output buffer into which the compressed frame is
  549. copied.  Note that this is not the size of the compressed frame; that
  550. information is stored into the first 16-bit word of the frame itself.  The
  551. argument out_max is passed to the routine to prevent it from producing a frame
  552. larger than the output buffer whose address is passed in.
  553.  
  554. SONARC version 2.1i    Copyright 1994 Speech Compression              Page 10
  555. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  556.  
  557. The function result is returned in the AX register, where most "C" and Pascal
  558. compilers expect it.  The result value is zero for normal, error-free
  559. processing.
  560.  
  561. Two error conditions are possible.  If insufficient stack space is allocated, a
  562. result of -2 is returned.  This occurs if the SP register is less than 
  563. approximately 2*order+184 at the time of the call to cmp8, or less than
  564. 2*order+364 at the time of the call to cmp16.  (Note: This is a change from
  565. prior versions where enough stack space had to be allocated to copy the entire
  566. input buffer.)
  567.  
  568. The second error condition occurs when the number of bytes of output buffer
  569. needed for the compressed input buffer exceeds the value of out_max, in which
  570. case a result value of -1 is returned.
  571.  
  572. ───────────────────────────────────────────────────────────────────────────
  573.  
  574. The "C" declarations for the 8- and 16-bit decompression routines are:
  575.  
  576.     extern int far pascal dcmp8(p_bytary p_input,
  577.                                 p_bytary p_output);
  578.  
  579.     extern int far pascal dcmp16(p_intary p_input,
  580.                                  p_intary p_output);
  581.  
  582. The corresponding Pascal declarations are:
  583.  
  584.     function dcmp8(p_input,
  585.                    p_output: p_bytary
  586.                   ): integer; far; external;
  587.  
  588.     function dcmp16(p_input,
  589.                     p_output: p_intary
  590.                    ): integer; far; external;
  591.  
  592. Both dcmp8 and dcmp16 take a compressed frame at p_input and decompress it into
  593. the output buffer starting at p_output[order].  The decompression routine gets
  594. the order datum from the byte at offset 7 in the input v2.1 compressed frame
  595. (see the frame header description in the File and Frame Formats section).  As
  596. previously explained, the header of the compressed frame contains, at fixed
  597. offsets, the lengths needed by the caller and the decompression routine to
  598. figure out how much buffer space to allocate and use, respectively.
  599.  
  600. As is the case for the compression routines, the function result is returned in
  601. the AX register.  The result value is zero for normal, error-free processing. 
  602. The only error condition, resulting in a returned value of -1, is if the
  603. checksum fails.  If this error occurs, it means that the input frame has been
  604. folded, spindled, and/or mutilated at some point following its creation by the
  605. compression routine.  Keep in mind that the entire frame must be passed to the
  606. decompression routine; partial frames cannot be decompressed.
  607.  
  608. Note that stack overflow is not checked for in the decompression modules.
  609. However, the stack space required by these routines is guaranteed to be less
  610. than 50 bytes.
  611.  
  612. The DS, SS, CS, BP, SI and DI registers are preserved by these routines.  No
  613. instructions unique to the '186, '286, '386, or '486 processors are used in the
  614. 8-bit modules.  The 16-bit modules, however, make use of the '386 instruction
  615. family whenever they "sense" that they are running on a '386 or better.
  616.  
  617. SONARC version 2.1i    Copyright 1994 Speech Compression              Page 11
  618. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  619.  
  620.                                   POSTSCRIPT
  621.  
  622. I picked the d.b.a. "Speech Compression" in 1992, when I started working on a
  623. technology for PCs capable of compressing speech signals lossily at ratios of
  624. over 10:1.  Currently no compression is available for speech at such ratios
  625. (of any quality, that is) that does not require either huge run-time tables
  626. (>100 Kbytes), or some sort of special hardware support, such as a DSP chip.
  627.  
  628. I got ZipTalk (as I called it) developed to the point where I could prove to
  629. myself that decompression of speech signals could be accomplished on an 8088
  630. processor running at 4.77 MHertz with processor to spare, using tables of
  631. probably not much more than 16K bytes.
  632.  
  633. The compression side is a complex, but solved, problem since it piggy-backs
  634. off of linear-predictive analysis.  In fact, the whole trick is to transform
  635. frequency-domain parameters obtained through LPC techniques into a special
  636. format that I have discovered, which then permits real-time conversion back
  637. into time-domain signals.  (I can say it faster than I can develop it!)
  638.  
  639. However, while waiting for some research documents to arrive by USnail, I was
  640. put in contact with a company which needed lossless audio compression, and I
  641. diverted my energy to the development of Sonarc.  (If you need Sonarc to be
  642. an acronym of something, and you don't like "SOuNd ARChival" then I suppose
  643. it could be "Some Outfit Nagged About Reversible Compression".)
  644.  
  645. I've spent a considerable amount of time researching various ways of doing
  646. "lossy" audio compression.  Earlier versions of Sonarc featured a "lossy"
  647. parameter -Ln[n], which achieved higher compression ratios while keeping the
  648. total amplitude distortion in the decompressed signal less than n.[n]%.
  649. Unfortunately, the compression phase was extremely compute-intensive and
  650. generally required overnight runs to compress any significant amount of audio
  651. files.  I've never tried combining this "lossy" with the -x and -o0 options;
  652. I suspect there would be a measurable amount of proton decay before it could
  653. finish.  I only left it out of this shareware version because it is so slow,
  654. and I didn't want that sullying Sonarc's otherwise fine reputation.  I'm still
  655. developing the "lossy" algorithm, though, and I'll have a "lossy" solution in
  656. the v2.2.  Don't ask me when; it'll be ready when it's ready.
  657.  
  658. I suppose, in retrospect, I might have called myself "Sound Compression" or
  659. some such (not being particularly imaginative in the naming department).  But
  660. I'm stuck with "Speech Compression", even though I now do general audio
  661. compression.
  662.  
  663. Sonarc is now being used as an installation utility in PC titles published by
  664. Interplay, Origin, and The Software Toolworks, among others.  Inquiries are
  665. welcome.  Contact me at 76635,3652@compuserve.com or voice phone (mail) at
  666. 509-466-2925.
  667.  
  668.                              Richard P. Sprague
  669.  
  670.