OBD:SNDD: Difference between revisions
m (changed link from "SNDD/Mac" to "SNDD_Mac")  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
{{OBD_File_Header | type=SNDD | prev=QTNA | next=StNA | name=Sound Data | family=Generic | align=center}}  | {{OBD_File_Header | type=SNDD | prev=QTNA | next=StNA | name=Sound Data | family=Generic | align=center}}  | ||
There are 2 different formats used by the SNDD files. Below is the dat file part used in the PC retail version.  | |||
Below is the dat file part   | |||
| Line 25: | Line 19: | ||
The Mac version and the PC demo version use a simpler format and it appears that there is no support for different sample rates (all sounds are sampled at 22050 Hz).  | |||
[[image:sndd_alm.gif]]  | |||
{{Table}}  | |||
{{OBDth}}  | |||
{{OBDtr| 0x00 | res_id   |FF0000| 01 D6 08 00 | 2262      | 02262-comguy_dth2.aif.SNDD }}  | |||
{{OBDtr| 0x04 | lev_id   |FFFF00| 01 00 00 06 | 3         | level 3 }}  | |||
{{OBDtr| 0x08 | int32    |FFC8C8| 01 00 00 00 | 1         | "number of channels" (can be 1 for 1 channel or 3 for 2 channels) }}  | |||
{{OBDtr| 0x0C | int32    |FFFFC8| 37 00 00 00 | 55        | duration in 1/60 seconds }}  | |||
{{OBDtr| 0x10 | int32    |C8FFC8| 5E 2A 00 00 | 10846     | size of the part in the raw file in bytes }}  | |||
{{OBDtr| 0x14 | offset   |C8FFFF| 00 B1 01 00 |00 01 B1 00| at this position starts the part in the raw file }}  | |||
{{OBDtr| 0x18 | char[8]  |FFC8FF| AD DE       | dead      | unused }}  | |||
|}  | |||
The raw data part of a SNDD file contains the actual audio samples without any other headers. To create a wav/aif file one needs to write a file header like below and then write the contents of the raw data part.  | |||
WAV files  | |||
Write "RIFF", add the size of the part in the raw file + 70 byte, write "WAVE", write "fmt ", add the wav header + change it's first byte from 8 to 32, write "data", add the size of the part in the raw file, add the raw file data and save it as a wav file.  | |||
[[image:sndd_wav.gif]]  | [[image:sndd_wav.gif]]  | ||
{{Table}}  | {{Table}}  | ||
| Line 44: | Line 61: | ||
AIF files  | |||
Write "FORM", add the size of the part in the raw file + 50 bytes, write "AIFC", write "COMM ", add the aif header + calculate its sample rate, write "SSND", add the size of the part in the raw file + 8 bytes, add 8 zero bytes, add the raw file data and save it as an aif file.  | |||
[[image:sndm_aif.gif]]  | |||
{{Table}}  | |||
{{OBDth}}  | |||
{{OBDtrBK|1=Complete aif format header (black outline) - Note: You have to read the Raw Hex content from left to right}}  | |||
{{OBDtr| 0x00 | char[4]  |FF0000| 46 4F 52 4D | FORM      | identification, that this file uses the "EA IFF 85" standard }}  | |||
{{OBDtr| 0x04 | int32    |FFFF00| 00 00 2A 90 | 10896     | size of the file from the the green coloured field to the end in bytes (<nowiki>=</nowiki> size of the part in the raw file + 50 bytes) }}  | |||
{{OBDtr| 0x08 | char[4]  |00FF00| 41 49 46 43 | AIFC      | identification, that this file is a AIFC file (compressed aif file) }}  | |||
{{OBDtr| 0x0C | char[4]  |00FFFF| 43 4F 4D 4D | COMM      | identification that the aif format header follows }}  | |||
{{OBDtr| 0x10 | block[26]|FFC8C8|        |      | [[OBD:SNDD/aif|aif header]] }}  | |||
{{OBDtr| 0x2A | char[4]  |FFFFC8| 53 53 4E 44 | SSND      | identification that the aif data follows }}  | |||
{{OBDtr| 0x2E | int32    |C8FFC8| 00 00 2A 66 | 10854     | size of the file from the the light blue coloured field to the end (<nowiki>=</nowiki> size of the part in the raw file + 8 bytes) }}  | |||
{{OBDtr| 0x32 | int32    |C8FFFF| 00 00 00 00 | 0         | offset; determines where the first sample in the data starts; in Oni it's always zero }}  | |||
{{OBDtr| 0x36 | int32    |FFC8FF| 00 00 00 00 | 0         | block size; used in conjunction with offset for block-aligning data; in Oni it's always zero }}  | |||
|}  | |||
{{OBD_File_Footer | type=SNDD | prev=QTNA | next=StNA | name=Sound Data | family=Generic}}  | {{OBD_File_Footer | type=SNDD | prev=QTNA | next=StNA | name=Sound Data | family=Generic}}  | ||
Revision as of 20:12, 16 November 2007
  | 
 | 
 
 | 
There are 2 different formats used by the SNDD files. Below is the dat file part used in the PC retail version.
| Offset | Type | Raw Hex | Value | Description | 
|---|---|---|---|---|
| 0x00 | res_id | 01 D7 08 00 | 2263 | 02263-comguy_dth2.aif.SNDD | 
| 0x04 | lev_id | 01 00 00 06 | 3 | level 3 | 
| 0x08 | block[54] | wav header | ||
| 0x3E | int16 | 37 00 | 55 | duration in 1/60 seconds | 
| 0x40 | int32 | 56 28 00 00 | 10326 | size of the part in the raw file in bytes | 
| 0x44 | offset | 20 10 59 00 | 00 59 10 20 | at this position starts the part in the raw file | 
| 0x48 | char[24] | AD DE | dead | unused | 
The Mac version and the PC demo version use a simpler format and it appears that there is no support for different sample rates (all sounds are sampled at 22050 Hz).
| Offset | Type | Raw Hex | Value | Description | 
|---|---|---|---|---|
| 0x00 | res_id | 01 D6 08 00 | 2262 | 02262-comguy_dth2.aif.SNDD | 
| 0x04 | lev_id | 01 00 00 06 | 3 | level 3 | 
| 0x08 | int32 | 01 00 00 00 | 1 | "number of channels" (can be 1 for 1 channel or 3 for 2 channels) | 
| 0x0C | int32 | 37 00 00 00 | 55 | duration in 1/60 seconds | 
| 0x10 | int32 | 5E 2A 00 00 | 10846 | size of the part in the raw file in bytes | 
| 0x14 | offset | 00 B1 01 00 | 00 01 B1 00 | at this position starts the part in the raw file | 
| 0x18 | char[8] | AD DE | dead | unused | 
The raw data part of a SNDD file contains the actual audio samples without any other headers. To create a wav/aif file one needs to write a file header like below and then write the contents of the raw data part.
WAV files
Write "RIFF", add the size of the part in the raw file + 70 byte, write "WAVE", write "fmt ", add the wav header + change it's first byte from 8 to 32, write "data", add the size of the part in the raw file, add the raw file data and save it as a wav file.
| Offset | Type | Raw Hex | Value | Description | 
|---|---|---|---|---|
| Complete ADPCM wav format header (black outline) | ||||
| 0x00 | char[4] | 52 49 46 46 | RIFF | identification that this file uses the IBM/Microsoft RIFF standard | 
| 0x04 | int32 | 9C 28 00 00 | 10396 | size of the wav file from the the green coloured field to the end in bytes (= size of the part in the raw file + 70 bytes) | 
| 0x08 | char[4] | 57 41 56 45 | WAVE | identification that this file is a WAVE file | 
| 0x0C | char[4] | 66 6D 74 20 | fmt | identification that the wav format header follows | 
| 0x10 | block[54] | wav header; note that it starts with a 32 and not with an 8 | ||
| 0x46 | char[4] | 64 61 74 61 | data | identification that the wav data follows | 
| 0x4A | int32 | 56 28 00 00 | 10326 | size of the following wav data in bytes (= size of the part in the raw file) | 
AIF files
Write "FORM", add the size of the part in the raw file + 50 bytes, write "AIFC", write "COMM ", add the aif header + calculate its sample rate, write "SSND", add the size of the part in the raw file + 8 bytes, add 8 zero bytes, add the raw file data and save it as an aif file.
| Offset | Type | Raw Hex | Value | Description | 
|---|---|---|---|---|
| Complete aif format header (black outline) - Note: You have to read the Raw Hex content from left to right | ||||
| 0x00 | char[4] | 46 4F 52 4D | FORM | identification, that this file uses the "EA IFF 85" standard | 
| 0x04 | int32 | 00 00 2A 90 | 10896 | size of the file from the the green coloured field to the end in bytes (= size of the part in the raw file + 50 bytes) | 
| 0x08 | char[4] | 41 49 46 43 | AIFC | identification, that this file is a AIFC file (compressed aif file) | 
| 0x0C | char[4] | 43 4F 4D 4D | COMM | identification that the aif format header follows | 
| 0x10 | block[26] | aif header | ||
| 0x2A | char[4] | 53 53 4E 44 | SSND | identification that the aif data follows | 
| 0x2E | int32 | 00 00 2A 66 | 10854 | size of the file from the the light blue coloured field to the end (= size of the part in the raw file + 8 bytes) | 
| 0x32 | int32 | 00 00 00 00 | 0 | offset; determines where the first sample in the data starts; in Oni it's always zero | 
| 0x36 | int32 | 00 00 00 00 | 0 | block size; used in conjunction with offset for block-aligning data; in Oni it's always zero | 
| ONI BINARY DATA | 
|---|
| QTNA << Other file types >> StNA | 
| SNDD : Sound Data | 
| Generic file | 



