home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / WINRE139.LZH / WINREC / ENGLISH / DVS.TXT < prev    next >
Text File  |  1994-01-25  |  4KB  |  138 lines

  1. DVSM Samples
  2. ------------
  3.  
  4. Every DVS sample begins with the following header:
  5.  
  6. typedef struct
  7. {
  8.     char magic[6];     
  9.     int headlen;       
  10.     unsigned int freq;          
  11.     char pack;        
  12.     char mode;        
  13.     long blocklen;     
  14. } DVSMHEAD;
  15.  
  16.  
  17. magic:
  18.     "DVSM\0\0"
  19. headlen:
  20.     header length = distance of the sound data from the start of file
  21.     Please use this entry to skip extension blocks (see below). The header length
  22.     has to be a even value!
  23. freq:
  24.     sampling frequency:
  25.             0-7 : allowed CODEC frequencies (0: 8kHz ...  7: 49kHz)
  26.             >256: sampling frequency in Hz
  27. pack:
  28.     0: ungepacked data
  29.     2: DVS delta packed data
  30.     4: DVS voice packed data (only WinRec Pro)
  31.     In future other values are possible. So test for 'pack==2' or 'pack'==4 and NOT for 'pack>0'
  32. mode:
  33.     Bit 0: 8/16 Bit
  34.     Bit 1: Stereo/Mono
  35. blocklen (only valid if 'pack'==2 and 'pack'==4 , at the moment):
  36.     Lenght of a packed block. This is NOT a fixed value. WinRec write different
  37.     block lengths, dependent of the used buffer.
  38.     
  39. extensions blocks
  40. -----------------
  41. DVS is modular format. The minimal header (16 bytes, see above) could followed by
  42. free extensions blocks. These blocks are a part of the header and the entry 'headlen'
  43. inludes this blocks. So (older) programms can skip this additional information.
  44.  
  45. A block has the following structure:
  46.  
  47.      4 Byte (cookie)   Identify
  48.      2 Byte (len)      Length
  49.  len-6 Bytes Data
  50.  
  51. WinRec knows (V1.38an higher) following extensions:
  52.  
  53. cookie            Lenght of the data    Usage
  54. -----------------------------------------------------------------------------------------
  55. 'CLCK'            1 word                 0: intern clock, 1: extern CD, 2: extern DAT
  56.  
  57. 'PEAK'            4 byte                one word for the left and right channel containing the
  58.                                     highest sample value
  59.                                     
  60. 'DSPE'            x bytes                DSP program (soundeffect !!) in binary format
  61.  
  62. 'PARA'            x bytes                x parameters for the sound effect. NOT before the 'DSPE'
  63.                                     block!
  64.  
  65. 'PACK'            128 or 8 bytes        Deltapack table for the distance values. Used instead of
  66.                                     the standard table (see below).
  67.                                     
  68. 'INFO'            x bytes                info text (e.g. full title)
  69.  
  70. Not use in WinRec (by now)
  71.  
  72. 'KARA'            x Bytes                karaoke text (see below)
  73.  
  74.  
  75. The maximal header length (all blocks together) is limited to 65535 Bytes. Every programm should parse
  76. the blocks, and decide to use them or not.
  77.  
  78. karaoke text format
  79. -------------------
  80.     long cookie='KARA'
  81.     int len
  82.     int textlen
  83.  
  84. followed by the text ('textlen' bytes) in standard ASCII format. After this the extension included
  85. a measure table, with a long word (4 byte) for every word in the text. The long word contains
  86. the time distance to the next word in 1/sampling frequency
  87.  
  88. deltapack format
  89. ----------------
  90.  (at the moment only for 16 Bit stereo or mono samples!!!!)
  91.  
  92. a block looks (for stereo) like this (length 'blocklen'):
  93.  
  94.  1. sound word left    (16 Bit)
  95.  1. sound word right   (16 Bit)
  96.  1. distance value left  (8 Bit)
  97.  1. distance value right (8 Bit)
  98.                  .
  99.                  .
  100.                  .
  101.  n. distance value left  (8 Bit)
  102.  n. distance value right (8 Bit)
  103.  
  104.  
  105. The distance values are pointer to a table with 'real'
  106. 16 Bit distance values. This table contains functions values of
  107.  
  108.                    / -1.084618362^-x  for x<0  (-128 to -1)
  109.             f(x)= {   0               for x=0  (0)
  110.                    \  1.084618362^x   for x>0  (1 to 127)
  111.                    
  112. The table has (logically) the length of 256 bytes.
  113.  
  114. voicepack format
  115. ----------------
  116.  (at the moment only for 16 Bit stereo or mono samples!!!!)
  117.  
  118. a block looks (for stereo) like this (length 'blocklen'):
  119.  
  120.  1. sound word left    (16 Bit)
  121.  1. sound word right   (16 Bit)
  122.  1. distance value left  (4 Bit)
  123.  1. distance value right (4 Bit)
  124.                  .
  125.                  .
  126.                  .
  127.  n. distance value left  (4 Bit)
  128.  n. distance value right (4 Bit)
  129.  
  130.  
  131. The distance values are pointer to a table with 'real'
  132. 16 Bit distance values:
  133.  
  134. -8192,-4096,-2048,-1024,-512,-256,-64,0,64,256,512,1024,2048,4096,8192
  135.  
  136.  
  137. Andreas Binner
  138.