VOCFMT0.TXT If anyone wishes to update this file, please do so. Just increment the file # before reposting to give a chance at minimizing confusion.. VOC FILE FORMAT VERSION 1.10 ============================ Header Block Offset in bytes (HEX) 0h-13h File Description, "Creative Voice File", 1Ah 14h-15h Offset of Data Block from start of file (in case header size changes) for now 1Ah 16h-17h Version #, for now 010Ah (vs 1.10) 18h-19h Identification code (test to verify this is VOC file) Complement of version # plus 1234h, currently 1129h 1Ah- Start of Data Block (may change...) Data Block is composed of multiple sub-blocks. 1st byte of EACH sub-block is type (BLKTYPE) Next 3 bytes of ALL sub-blocks except type 0, is 24-bit sub-block length (BLKLEN) in bytes (excluding BLKTYPE and BLKLEN fields), i.e. how many bytes left in sub-block If your program doesn't handle a BLKTYPE, just skip BLKLEN more bytes to get to next block. BLOCK TYPE (fields following BLKLEN shown as field:length) 0 Has no length field. Marks end of Data Block (EOF). 1 SR:1 PACK:1 DATA:BLKLEN-2 SR (sampling rate), SR=256-1000000/rate, for 10,000HZ SR = 156 PACK (compression method of DATA) 0-8bit raw, 1-4bit, 2-2.6bit, 3-2bit The compression modes are called ADPCM but I don't know how to pack/unpack them, most files floating about are the 8bit raw.. 2 MoreData:BLKLEN Continues data from previous block 3 PERIOD:2 SR:1 PERIOD+1 is length of silence. (in # of samples I believe) SR (sample rate) see above.. 4 MARKER:2 When encountered, driver sets flag. Program may check for value to synchronize with driver. 5 ASCII data:BLKLEN This must be a null-terminated string. (Ignore it, print it out, whatever..) 6 COUNT:2 Repeat count. Data blocks between this and next EndRepeat block should be repeated COUNT+1 times. COUNT = 0xFFFF means endless loop. I don't believe nested repeat blocks are allowed although they would be easy to implement.. 7 EndRepeat (BLKLEN is 0) I took the liberty of making this terse... GOOD LUCK.