SoundLib format =============== A SoundLib file is a chunk file and has type C47. There must be a NAM1 chunk and either one WAV1 chunk or one WAV2 chunk or one WAV3 chunk. The following chunks are defined: WAV1 ==== Offset 0 Number of samples 4 Sample 1: offset from wavetable start to sample 8 length of sample in bytes 12 default pitch (as VIDC pitch value) 16 (one further word not used) 20 Sample 2: four words as above 36 Sample 3: four words as above .. other sample headers... .. sample data (8 bit VIDC logarithmic) WAV2 ==== Just like WAV1 except the sample data is in 4 bit ADPCM format, and the sample length words in the header are the length in SAMPLES i.e. the number of half-bytes present. A sample which is an odd number of samples long is padded to the next byte boundary. WAV3 ==== Offset 0 Number of samples 4 Sample 1: offset from wavetable start to sample data 8 length of sample data 12 default pitch (actual sample rate in Hz) 16 0 => sample is 8 bit linear unsigned mono 1 => sample is 8 bit linear unsigned stereo 2 => sample is 16 bit linear signed mono 3 => sample is 16 bit linear signed stereo 4 => sample is 8 bit VIDC log (as WAV1) 8 => sample is 4 bit ADPCM coding of 16 bit linear signed (as WAV2) >19 => offset from wavetable start to: 0 size of format block 4.. WAV file format block (as loaded from a PC .wav file) 20 Sample 2: four words as above 36 Sample 3: four words as above .. other sample headers... .. data For ADPCM format sounds (fourth word of sample header = 8) the length word (second word of sample header) is the number of SAMPLES present; in all other cases it is the number of BYTES. The case where the fourth word of the sample header is >19 can be regarded as rare; in this case the format block pointed to is the structure described under WAVEFORMAT in the Win32 Programmers' Reference. Almost all WAV files found on PCs are of the types already covered without needing a WAVEFORMAT structure, but, for instance, some Microsoft applications come with WAV files in their own ADPCM format, not quite like ours. NAM1 ==== This chunk is written by editing applications to give names to the samples. int next - word aligned char name1 - zero terminated int next - word aligned char name2 - zero terminated etc.