5,389
edits
No edit summary |
m (sorta done) |
||
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}} | ||
=dat= | |||
There are 2 different formats used by the SNDD files. | |||
==PC retail== | |||
Below is the dat file part used in the PC retail version. | |||
[[image:sndd_all.gif]] | [[image:sndd_all.gif]] | ||
Line 19: | Line 22: | ||
The Mac version and the PC demo version use a simpler format | ---- | ||
==PC demo and Mac== | |||
The Mac version and the PC demo version use a simpler format. | |||
It appears that there is no support for different sample rates (all sounds are sampled at 22050 Hz). | |||
Line 37: | Line 43: | ||
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. | ---- | ||
---- | |||
=raw= | |||
WAV files | The raw data part of a SNDD file contains the actual audio samples without any other headers. | ||
==export and import== | |||
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. | |||
Write "RIFF" | ===WAV files=== | ||
*Write "RIFF" | |||
*add the size of the part in the raw file + 70 bytes | |||
*write "WAVE" | |||
*write "fmt " | |||
*add the wav header + change its first byte from 8 to 32 | |||
*write "data" | |||
*add the size of the part in the raw file | |||
*add the raw file data | |||
*save it as a wav file. | |||
[[image:sndd_wav.gif]] | [[image:sndd_wav.gif]] | ||
Line 51: | Line 65: | ||
{{OBDth}} | {{OBDth}} | ||
{{OBDtrBK|1=Complete ADPCM wav format header (black outline)}} | {{OBDtrBK|1=Complete ADPCM wav format header (black outline)}} | ||
{{OBDtr| 0x00 | char[4] |FF0000| 52 49 46 46 | RIFF | | {{OBDtr| 0x00 | char[4] |FF0000| 52 49 46 46 | RIFF | identifier for the "IBM/Microsoft RIFF" standard }} | ||
{{OBDtr| 0x04 | int32 |FFFF00| 9C 28 00 00 | 10396 | size of the | {{OBDtr| 0x04 | int32 |FFFF00| 9C 28 00 00 | 10396 | size of the file from 0x08 to the end (<nowiki>=</nowiki> size of the .raw part + 70 bytes) }} | ||
{{OBDtr| 0x08 | char[4] |00FF00| 57 41 56 45 | WAVE | | {{OBDtr| 0x08 | char[4] |00FF00| 57 41 56 45 | WAVE | identifier for the "WAVE" format }} | ||
{{OBDtr| 0x0C | char[4] |00FFFF| 66 6D 74 20 | fmt | | {{OBDtr| 0x0C | char[4] |00FFFF| 66 6D 74 20 | fmt | identifier announcing the following wav format header }} | ||
{{OBDtr| 0x10 | block[54]|FFC8C8| | | [[OBD:SNDD/wav|wav header]]; note that it starts with a 32 and not with an 8 }} | {{OBDtr| 0x10 | block[54]|FFC8C8| | | [[OBD:SNDD/wav|wav header]]; note that it starts with a 32 and not with an 8 }} | ||
{{OBDtr| 0x46 | char[4] |FFFFC8| 64 61 74 61 | data | | {{OBDtr| 0x46 | char[4] |FFFFC8| 64 61 74 61 | data | identifier announcing the following wav data }} | ||
{{OBDtr| 0x4A | int32 |C8FFC8| 56 28 00 00 | 10326 | size of the following wav data in bytes (<nowiki>=</nowiki> size of the part | {{OBDtr| 0x4A | int32 |C8FFC8| 56 28 00 00 | 10326 | size of the following wav data in bytes (<nowiki>=</nowiki> size of the .raw part) }} | ||
|} | |} | ||
AIF files | ---- | ||
===AIF files=== | |||
*Write "FORM" | |||
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 (always 22) | |||
*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 the [[wikipedia:Big Endian|Big Endian]] order | |||
[[image:sndm_aif.gif]] | [[image:sndm_aif.gif]] | ||
Line 72: | Line 93: | ||
{{Table}} | {{Table}} | ||
{{OBDth}} | {{OBDth}} | ||
{{OBDtrBK| | {{OBDtrBK|Complete aif format header (black outline) }} | ||
{{OBDtr| 0x00 | char[4] |FF0000| 46 4F 52 4D | FORM | | {{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 | {{OBDtr| 0x04 | int32 |FFFF00| 00 00 2A 90 | 10896 | size of the file from 0x08 to the end (<nowiki>=</nowiki> size of the .raw part + 50 bytes) }} | ||
{{OBDtr| 0x08 | char[4] |00FF00| 41 49 46 43 | AIFC | | {{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 | | {{OBDtr| 0x0C | char[4] |00FFFF| 43 4F 4D 4D | COMM | identifier announcing the following aif format header }} | ||
{{OBDtr| 0x10 | block[26]|FFC8C8| | | [[OBD:SNDD/aif|aif header]] }} | {{OBDtr| 0x10 | block[26]|FFC8C8| | | [[OBD:SNDD/aif|aif header]] }} | ||
{{OBDtr| 0x2A | char[4] |FFFFC8| 53 53 4E 44 | SSND | | {{OBDtr| 0x2A | char[4] |FFFFC8| 53 53 4E 44 | SSND | identifier announcing the following aif data }} | ||
{{OBDtr| 0x2E | int32 |C8FFC8| 00 00 2A 66 | 10854 | size of the file from | {{OBDtr| 0x2E | int32 |C8FFC8| 00 00 2A 66 | 10854 | size of the file from 0x32 to the end (<nowiki>=</nowiki> size of the .raw part + 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| 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 }} | {{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 }} |