19,703
edits
m (actually that section doesn't exist, and it's not needed anyway)  | 
				m (replaced formula GIFs with Math markup; replaced nowiki tags around equals signs with new {{=}} magic word)  | 
				||
| Line 15: | Line 15: | ||
{{OBDth}}  | {{OBDth}}  | ||
{{OBDtr| 0x00 | char[4]  |FF0000| 46 4F 52 4D | FORM      | identifier for the "EA IFF 85" standard }}  | {{OBDtr| 0x00 | char[4]  |FF0000| 46 4F 52 4D | FORM      | identifier for the "EA IFF 85" standard }}  | ||
{{OBDtr| 0x04 | int32    |FFFF00| 00 00 2A 90 | 10896     | size of the file from 0x08 to the end (  | {{OBDtr| 0x04 | int32    |FFFF00| 00 00 2A 90 | 10896     | size of the file from 0x08 to the end ({{=}} size of the raw IMA4 data + 50 bytes) }}  | ||
{{OBDtr| 0x08 | char[4]  |00FF00| 41 49 46 43 | AIFC      | identifier for the "AIFC" format (compressed aif file) }}  | {{OBDtr| 0x08 | char[4]  |00FF00| 41 49 46 43 | AIFC      | identifier for the "AIFC" format (compressed aif file) }}  | ||
{{OBDtr| 0x0C | char[4]  |00FFFF| 43 4F 4D 4D | COMM      | identifier announcing the following aif format header (COMM stands for "common")}}  | {{OBDtr| 0x0C | char[4]  |00FFFF| 43 4F 4D 4D | COMM      | identifier announcing the following aif format header (COMM stands for "common")}}  | ||
{{OBDtr| 0x10 | block[26]|FFC8C8|        |      | COMM data (a.k.a. AIFC format header, similar to a WAVE file's "fmt"; see below) }}  | {{OBDtr| 0x10 | block[26]|FFC8C8|        |      | COMM data (a.k.a. AIFC format header, similar to a WAVE file's "fmt"; see below) }}  | ||
{{OBDtr| 0x2A | char[4]  |FFFFC8| 53 53 4E 44 | SSND      | identifier announcing the following aif data (actual stream + stream size + 2 more parameters) }}  | {{OBDtr| 0x2A | char[4]  |FFFFC8| 53 53 4E 44 | SSND      | identifier announcing the following aif data (actual stream + stream size + 2 more parameters) }}  | ||
{{OBDtr| 0x2E | int32    |C8FFC8| 00 00 2A 66 | 10854     | size of the following SSND data (  | {{OBDtr| 0x2E | int32    |C8FFC8| 00 00 2A 66 | 10854     | size of the following SSND data ({{=}} size of the raw IMA4 data + 8 bytes)  | ||
:(since SSND is the last section, this is also the remaining file size, from 0x32 to the end) }}  | :(since SSND is the last section, this is also the remaining file size, from 0x32 to the end) }}  | ||
{{OBDtr| 0x32 | int32    |C8FFFF| 00 00 00 00 | 0         | "offset"; determines where the first sample in the data starts; typically zero }}  | {{OBDtr| 0x32 | int32    |C8FFFF| 00 00 00 00 | 0         | "offset"; determines where the first sample in the data starts; typically zero }}  | ||
| Line 28: | Line 28: | ||
Here is the detail of the format header at 0x10:  | Here is the detail of the format header at 0x10:  | ||
[[  | [[Image:sndd_hdm.gif]]  | ||
{{Table}}  | {{Table}}  | ||
{{OBDth}}  | {{OBDth}}  | ||
{{OBDtr| 0x10 | int32    |FFC8C8| 00 00 00 16 | 22    | size of the following COMM data (AIFC format settings) }}  | {{OBDtr| 0x10 | int32    |FFC8C8| 00 00 00 16 | 22    | size of the following COMM data (AIFC format settings) }}  | ||
{{OBDtr| 0x14 | int16    |FFFFC8| 00 01       | 1     | number of channels (1   | {{OBDtr| 0x14 | int16    |FFFFC8| 00 01       | 1     | number of channels (1 {{=}} mono) }}  | ||
{{OBDtr| 0x16 | int32    |C8FFC8| 00 00 01 3F | 319   |   | {{OBDtr| 0x16 | int32    |C8FFC8| 00 00 01 3F | 319   | number of frames: <math>\frac{\text{size of the part in the raw file}}{\text{number of channels}*34}</math> }}  | ||
{{OBDtr| 0x1A | int16    |C8FFFF| 00 10       | 16    | bits per sample }}  | {{OBDtr| 0x1A | int16    |C8FFFF| 00 10       | 16    | bits per sample }}  | ||
{{OBDtr| 0x1C | float80  |FFC8FF| 40 0D AC... | 22050 | samples per second (a.k.a. "frequency" or "sample rate")  | {{OBDtr| 0x1C | float80  |FFC8FF| 40 0D AC... | 22050 | samples per second (a.k.a. "frequency" or "sample rate")  | ||
| Line 44: | Line 44: | ||
At 0x3A start the IMA4 frames, each of them 34 bytes long and coding for 64 samples. Here is a view of a stereo .aif file (based on Oni's SNDDalarm_loop.aif), showing how the IMA4 frames are organized.  | At 0x3A start the IMA4 frames, each of them 34 bytes long and coding for 64 samples. Here is a view of a stereo .aif file (based on Oni's SNDDalarm_loop.aif), showing how the IMA4 frames are organized.  | ||
[[  | [[Image:sndm_aif2.gif]]  | ||
{{Table}}  | {{Table}}  | ||
{{OBDth}}  | {{OBDth}}  | ||
{{OBDtr| 0x00 | char[4]  |FF0000| 46 4F 52 4D | FORM  | identifier for the "EA IFF 85" standard }}  | {{OBDtr| 0x00 | char[4]  |FF0000| 46 4F 52 4D | FORM  | identifier for the "EA IFF 85" standard }}  | ||
{{OBDtr| 0x04 | int32    |FFFF00| 00 01 16 4E | 71246 | size of the file from 0x08 to the end (  | {{OBDtr| 0x04 | int32    |FFFF00| 00 01 16 4E | 71246 | size of the file from 0x08 to the end ({{=}} size of the raw IMA4 data + 50 bytes) }}  | ||
{{OBDtr| 0x08 | char[4]  |00FF00| 41 49 46 43 | AIFC  | identifier for the "AIFC" format (compressed aif file) }}  | {{OBDtr| 0x08 | char[4]  |00FF00| 41 49 46 43 | AIFC  | identifier for the "AIFC" format (compressed aif file) }}  | ||
{{OBDtr| 0x0C | char[4]  |00FFFF| 43 4F 4D 4D | COMM  | identifier announcing the following aif format header (COMM stands for "common")}}  | {{OBDtr| 0x0C | char[4]  |00FFFF| 43 4F 4D 4D | COMM  | identifier announcing the following aif format header (COMM stands for "common")}}  | ||
{{OBDtr| 0x10 | int32    |FFC8C8| 00 00 00 16 | 22    | size of the following COMM data (AIFC format settings) }}  | {{OBDtr| 0x10 | int32    |FFC8C8| 00 00 00 16 | 22    | size of the following COMM data (AIFC format settings) }}  | ||
{{OBDtr| 0x14 | int16    |FFFFC8| 00 02       | 2     | number of channels (2   | {{OBDtr| 0x14 | int16    |FFFFC8| 00 02       | 2     | number of channels (2 {{=}} stereo) }}  | ||
{{OBDtr| 0x16 | int32    |C8FFC8| 00 00 04 17 | 1047  |   | {{OBDtr| 0x16 | int32    |C8FFC8| 00 00 04 17 | 1047  | number of frames: <math>\frac{\text{size of the part in the raw file}}{\text{number of channels}*34}</math> }}  | ||
{{OBDtr| 0x1A | int16    |C8FFFF| 00 10       | 16    | bits per sample }}  | {{OBDtr| 0x1A | int16    |C8FFFF| 00 10       | 16    | bits per sample }}  | ||
{{OBDtr| 0x1C | float80  |FFC8FF| 40 0D AC... | 22050 | samples per second (a.k.a. "frequency" or "sample rate")  | {{OBDtr| 0x1C | float80  |FFC8FF| 40 0D AC... | 22050 | samples per second (a.k.a. "frequency" or "sample rate")  | ||
| Line 60: | Line 60: | ||
{{OBDtr| 0x26 | char[4]  |FFC800| 69 6D 61 34 | ima4  | compression type }}  | {{OBDtr| 0x26 | char[4]  |FFC800| 69 6D 61 34 | ima4  | compression type }}  | ||
{{OBDtr| 0x2A | char[4]  |00FFC8| 53 53 4E 44 | SSND  | identifier announcing the following aif data (actual stream + stream size + 2 more parameters) }}  | {{OBDtr| 0x2A | char[4]  |00FFC8| 53 53 4E 44 | SSND  | identifier announcing the following aif data (actual stream + stream size + 2 more parameters) }}  | ||
{{OBDtr| 0x2E | int32    |FF00C8| 00 01 16 24 | 71204 | size of the following SSND data (  | {{OBDtr| 0x2E | int32    |FF00C8| 00 01 16 24 | 71204 | size of the following SSND data ({{=}} size of the raw IMA4 data + 8 bytes)  | ||
:(since SSND is the last section, this is also the remaining file size, from 0x32 to the end) }}  | :(since SSND is the last section, this is also the remaining file size, from 0x32 to the end) }}  | ||
{{OBDtr| 0x32 | int32    |C8FF00| 00 00 00 00 | 0     | "offset"; determines where the first sample in the data starts; typically zero }}  | {{OBDtr| 0x32 | int32    |C8FF00| 00 00 00 00 | 0     | "offset"; determines where the first sample in the data starts; typically zero }}  | ||
| Line 75: | Line 75: | ||
*For the stereo example, there are 1047 frames of 68 bytes each (a stereo frame is the combination of a Left frame and a Right frame), or 71196 bytes (8 bytes less than 0x11624, 50 bytes less than 0x1164E).  | *For the stereo example, there are 1047 frames of 68 bytes each (a stereo frame is the combination of a Left frame and a Right frame), or 71196 bytes (8 bytes less than 0x11624, 50 bytes less than 0x1164E).  | ||
The SNDD file in .dat receives the offset to the .raw data as well as several parameters that depend on the engine version.    | The SNDD file in .dat receives the offset to the .raw data as well as several parameters that depend on the engine version.    | ||
===Filling in Mac SNDD===  | ===Filling in Mac SNDD===  | ||
Here is how the SNDD instance should look (in .dat) for the above mono example:  | Here is how the SNDD instance should look (in .dat) for the above mono example:  | ||
[[  | [[Image:sndd_alm.gif]]  | ||
*The "compressed" flag is set (because IMA4 is a compressed format; however, if the flag isn't set, the Mac engine will process the data as IMA4 anyway).  | *The "compressed" flag is set (because IMA4 is a compressed format; however, if the flag isn't set, the Mac engine will process the data as IMA4 anyway).  | ||
| Line 89: | Line 90: | ||
Here is how the SNDD instance looks (in an .oni file) for the above stereo example:  | Here is how the SNDD instance looks (in an .oni file) for the above stereo example:  | ||
[[  | [[Image:sndd_alm2.gif]]  | ||
Same as above, except:  | Same as above, except:  | ||
| Line 101: | Line 102: | ||
Here is how the PC retail SNDD instance will look (in an .oni file) for the above stereo example:  | Here is how the PC retail SNDD instance will look (in an .oni file) for the above stereo example:  | ||
[[  | [[Image:sndd_alm4.gif]]  | ||
All the fields can be zeroed out or filled with garbage, except:  | All the fields can be zeroed out or filled with garbage, except:  | ||