DVSM

From Atari Wiki
Revision as of 17:14, 19 March 2016 by Admin (talk | contribs)
Jump to navigation Jump to search

DVSM Sample File Format was introduced by Andreas Binner along with WinRec in approximately 1994.


The following is taken from (Andreas Binner) WinRec documentation.


DVSM Samples Every DVS sample begins with the following header:

typedef struct < char magic[6]; int headlen; unsigned int freq; char pack; char mode; long blocklen; > DVSMHEAD; magic: "DVSM\0\0" headlen: header length = distance of the sound data from the start of file Please use this entry to skip extension blocks (see below). The header length has to be a even value! freq: sampling frequency: 0-7 : allowed CODEC frequencies (0: 8kHz ... 7: 49kHz) >256: sampling frequency in Hz pack: 0: ungepacked data 2: DVS delta packed data 4: DVS voice packed data (only WinRec Pro) 5: ADPCM (only WinRec Pro) In future other values are possible. So test for 'pack==x' and NOT for 'pack>0' mode: Bit 0: 8/16 Bit Bit 1: Stereo/Mono blocklen (only valid if 'pack'==2 and 'pack'==4 , at the moment): Length of a packed block. This is NOT a fixed value. WinRec write different block lengths, dependent of the used buffer. 'blocklen' has to be an even number!


extensions blocks DVS is modular format. The minimal header (16 bytes, see above) could followed by free extensions blocks. These blocks are a part of the header and the entry 'headlen' inludes this blocks. So (older) programms can skip this additional information.

A block has the following structure:

4 Byte (cookie) Identify 2 Byte (len) Length len-6 Bytes Data

WinRec knows (V1.38 and higher) following extensions:


cookie Lenght of the data Usage

'CLCK' 1 word 0: intern clock, 1: extern CD, 2: extern DAT

'PEAK' 4 byte one word for the left and right channel containing the highest sample value

'DSPE' x bytes DSP program (soundeffect !!) in binary format

'PARA' x bytes x parameters for the sound effect. NOT before the 'DSPE' block!

'PACK' 128 or 8 bytes Deltapack table for the distance values. Used instead of the standard table (see below).

'INFO' x bytes info text (e.g. full title)

Not use in WinRec (by now)

'KARA' x Bytes karaoke text (see below)


The maximal header length (all blocks together) is limited to 65535 Bytes. Every programm should parse the blocks, and decide to use them or not.


karaoke text format

long cookie='KARA' int len int textlen

followed by the text ('textlen' bytes) in standard ASCII format. After this the extension included a measure table, with a long word (4 byte) for every word in the text. The long word contains the time distance to the next word in 1/sampling frequency


deltapack format

(at the moment only for 16 Bit stereo or mono samples!!!!)

a block looks (for stereo) like this (length 'blocklen'):

1. sound word left (16 Bit) 1. sound word right (16 Bit) 1. distance value left (8 Bit) 1. distance value right (8 Bit) . . . n. distance value left (8 Bit) n. distance value right (8 Bit)


The distance values are pointer to a table with 'real' 16 Bit distance values. This table contains functions values of

/ -1.084618362^-x for x<0 (-128 to -1) f(x)= < 0 for x=0 (0) \ 1.084618362^x for x>0 (1 to 127)

The table has (logically) the length of 256 bytes.

voicepack format

(at the moment only for 16 Bit stereo or mono samples!!!!)

a block looks (for stereo) like this (length 'blocklen'):

1. sound word left (16 Bit) 1. sound word right (16 Bit) 1. distance value left (4 Bit) 1. distance value right (4 Bit) . . . n. distance value left (4 Bit) n. distance value right (4 Bit)


The distance values are pointer to a table with 'real' 16 Bit distance values:

-8192,-4096,-2048,-1024,-512,-256,-64,0,64,256,512,1024,2048,4096,8192


Andreas Binner