OBD:SNDD/wav: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (link fix)
m (fixed the mistake in the second GIF)
Line 19: Line 19:
{{OBDtrBK|1=Special extended ADPCM wav format header (black outline)}}
{{OBDtrBK|1=Special extended ADPCM wav format header (black outline)}}
{{OBDtr| 0x1C | int16    |C87C64| 20 00      | 32    | size of the following extended information part in bytes }}
{{OBDtr| 0x1C | int16    |C87C64| 20 00      | 32    | size of the following extended information part in bytes }}
{{OBDtr| 0x1E | int16    |B0C3D4| F4 03      | 1012  | [[image:sndd_hd2.gif]]
{{OBDtr| 0x1E | int16    |B0C3D4| F4 03      | 1012  | [[image:sndd_hd2.gif]] }}
'''N.B.''' For stereo, the -7 in the numerator is replaced with a -14. [[User:Geyser|geyser]] ([[User talk:Geyser|talk]])}}
{{OBDtr| 0x20 | int16    |E7CEA5| 07 00      | 7    | number of the following coefficient sets }}
{{OBDtr| 0x20 | int16    |E7CEA5| 07 00      | 7    | number of the following coefficient sets }}
|-align=center valign=top
|-align=center valign=top

Revision as of 22:04, 25 May 2021

Wav Header          Aif Header


Oni PC sound data uses an ADPCMWAVEFORMAT header.


Sndd hd.gif


Offset Type Raw Hex Value Description
0x0C int16 02 00 2 format ID (2 = ADPCM format)
0x0E int16 01 00 1 number of channels (1 = mono)
0x10 int32 22 56 00 00 22050 samples per seconds; (also known as "frequency" or "sample rate")
0x14 int32 93 2B 00 00 11155 File:Sndd hd1.gif
0x18 int16 00 02 512 block alignment; used for buffer estimation; (the block alignment of 22050 samples per second is

always 512 bytes)

0x1A int16 04 00 4 bits per sample
Special extended ADPCM wav format header (black outline)
0x1C int16 20 00 32 size of the following extended information part in bytes
0x1E int16 F4 03 1012 File:Sndd hd2.gif
0x20 int16 07 00 7 number of the following coefficient sets
0x22 int16-16 00 01 00 00 256, 0

The 14 coefficients are standard and are used by the wave to play.

The seven coefficient sets are preset. They must appear in this order.

0x26 int16-16 00 02 00 FF 512, -256
0x2A int16-16 00 00 00 00 0, 0
0x2E int16-16 C0 00 40 00 192, 64
0x32 int16-16 F0 00 00 00 240, 0
0x36 int16-16 CC 01 30 FF 460, -208
0x3A int16-16 88 01 18 FF 392, -232


Below are the three types of headers occurring in Oni


22.05 kHz mono
  • 1 channel
  • sample rate 22050 Hz
  • average rate 11155, truncated from ~11155.7312253 = 22050*512/1012
  • block alignment 512
  • 4 bits per sample
  • 1012 samples per block = 2 + (512 - 7)*8/4/1
  • standard coefficient table
0x00:  °° °° °° °° °° °° °° °° 08 00 00 00 02 00 01 00  °°°°°°°°°°°°°°°°
0x10:  22 56 00 00 93 2B 00 00 00 02 04 00 20 00 F4 03  °°°°°°°°°°°°°°°°
0x20:  07 00 00 01 00 00 00 02 00 FF 00 00 00 00 C0 00  °°°°°°°°°°°°°°°°
0x30:  40 00 F0 00 00 00 CC 01 30 FF 88 01 18 FF °° °°  °°°°°°°°°°°°°°°°

22.05 kHz stereo
  • 2 cnannels
  • sample rate 22050 Hz
  • average rate 22311, truncated from ~22311.4624506 = 22050*1024/1012
  • block alignment 1024
  • 4 bits per sample
  • 1012 samples per block = 2 + (1024 - 2*7)*8/4/2
  • standard coefficient table
0x00:  °° °° °° °° °° °° °° °° 08 00 00 00 02 00 02 00  °°°°°°°°°°°°°°°°
0x10:  22 56 00 00 27 57 00 00 00 04 04 00 20 00 F4 03  °°°°°°°°°°°°°°°°
0x20:  07 00 00 01 00 00 00 02 00 FF 00 00 00 00 C0 00  °°°°°°°°°°°°°°°°
0x30:  40 00 F0 00 00 00 CC 01 30 FF 88 01 18 FF °° °°  °°°°°°°°°°°°°°°°

44 kHz mono
  • 1 channel
  • sample rate 44100 kHz
  • average rate 22179, truncated from ~22179.9607073 = 44100*1024/2036
  • block alignment 1024
  • 4 bits per sample
  • 2036 samples per block = 2 + (1024 - 7)*8/4/1
  • standard coefficient table
0x00:  °° °° °° °° °° °° °° °° 08 00 00 00 02 00 01 00  °°°°°°°°°°°°°°°°
0x10:  44 AC 00 00 A3 56 00 00 00 04 04 00 20 00 F4 07  °°°°°°°°°°°°°°°°
0x20:  07 00 00 01 00 00 00 02 00 FF 00 00 00 00 C0 00  °°°°°°°°°°°°°°°°
0x30:  40 00 F0 00 00 00 CC 01 30 FF 88 01 18 FF °° °°  °°°°°°°°°°°°°°°°

List of the (relatively rare) 44 kHz sounds and their OSBDs (without the .aif suffix):

  • SNDDap_hit_shld (1 sound, referenced in OSBDap_hit_shld.grp, present in level0)
  • SNDDzap01 to SNDDzap45 (45 sounds, OSBDelec_detail.grp, in level9 and level10)
  • SNDDzap03, SNDDzap04, SNDDzap07, SNDDzap20, SNDDzap26, SNDDzap32 and SNDDzap40
    (7 sounds, OSBDelecfire_detail.grp, in level3, level4, level6, level8, level9, level10 and level18)
Back to SNDD