OBD:SNDD Mac
|
|
Below is the dat file part of the SNDD file.
| 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, see note below) |
| 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 |
So, how to create playable aif files? Look at the pic below. It shows the beginning of the comguy_dth2.aif sound.
| 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 |
Just 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.
Note: In the Mac version all files are sampled at 22050 Hz unlike the PC version that includes some files sampled at 44100 Hz. There appears to be no way to use different sammple rates on Mac except if the "number of channels" field is actually a group of flags (bit 0 is always 1 and bit 1 indicates the number of channels). Files that have the same sample rate on PC and Mac have identical raw data parts.
| ONI BINARY DATA |
|---|
| QTNA << Other file types >> StNA |
| SNDD : Sound Data |
| Generic file |

