Introduction
VOC is the sound file of Creative Labs’ Sound Blaster cards, from the MS-DOS era. Many DOS games stored their speech and sound effects as VOC files, and the tools that came with the card recorded and played them. The audio is usually 8-bit unsigned PCM, and the file can also hold silence, markers, text and repeat loops.
Structure
The file starts with the text Creative Voice File and the byte
1A, 20 bytes in all. Three little-endian 16-bit values follow: the offset
of the first block (usually 26), the version (such as 0x010A or
0x0114) and a check value equal to the complement of the version plus
0x1234.
The rest is a list of blocks. Each block starts with a type byte and a 24-bit length. Type 1 holds sound data, starting with a time constant byte (the sample rate is 1000000 / (256 − time constant)) and a codec byte. Type 2 continues the previous sound data. Other types give silence (3), a marker (4), text (5), the start and end of a repeat (6 and 7), extended settings for stereo and high rates (8), and sound data with an explicit sample rate, bit depth and channel count (9). A block of type 0 ends the file.
0Signature Creative Voice File, 1A20 bytes20Header data offset, version, check value6 bytes26Blocks type, 24-bit length, datarepeated…Terminator block type 01 byte
Links
Software
Developers
- libsndfile – library that reads and writes VOC (C)