Wave Dictionary: Difference between revisions

1,537 bytes removed ,  11 months ago
m
(Link to RwaWaveFormat section)
 
(42 intermediate revisions by 3 users not shown)
Line 1:
The '''RenderWare Audio Wave Dictionary''' container format is used to store a collection of audio files, or "waves." It uses the file extension <code>.awd</code>. Each wave is of type <code>RwaWave</code> and is stored in a <code>RwLLNode</code> in an <code>RwLinkList</code>.
 
= Layout =
{| class="wikitable" style=text-align:left
! Offset
! Name
! Type
! Value
! Description
|-
| 0x00 || uint32_t || <code>0x809</code> || Magic number.
! colspan="5" | Header
|-
| 0x04 || uint32_t || || The single byte at 0x04 seems to be a Big Endian bool.
|-
| 0x08 || uintptr_t || || Pointer to audio data.
|-
| 0x0C || [[Wave Dictionary#RwaWaveDict|RwaWaveDict]]* || || Pointer to wave dictionary.
|-
| 0x10 || uint32_t || ||
|-
| 0x14 || uint32_t || || Audio data size. ‎
|-
| 0x18 || [[Wave Dictionary#RwaUUID|RwaUUID]] || style="text-align:right" | Xbox: <code>73F2018B 75DFF081 4BC8E45F 453A2D04</code><br>‎‎‎‎PS2: <code>5393C7DB EA6481AE 4917FC38 AAEAC9AC</code><br>GCN: <code>48F6C70A 72142484 6A4279E1 D3329DFD</code> || Platform UUID.
|-
| 0x28 || uintptr_t || || Pointer to audio data.
|-
|}
 
== RwaUUID ==
{{ MemoryLocationTableRow | name= | offset=0x00 | type=RwUInt32 | value=0x809 | description=Magic Number. }}
{| class="wikitable" style=text-align:left
! Offset
! Type
! Name
|-
| 0x00 || uint32_t || time_low
{{ MemoryLocationTableRow | name= | offset=0x04 | value= | type=uintptr_t | description=Pointer to location in system memory. Usually <code>nullptr</code>. }}
|-
| 0x04 || uint16_t || time_mid
{{ MemoryLocationTableRow | name= | offset=0x08 | value= | type=UInt32 | description=Container size. }}
|-
| 0x06 || uint16_t || time_hi_and_version
{{ MemoryLocationTableRow | name= | offset=0x0C | value= | type=UInt32 | description=Container header size. }}
|-
| 0x08 || uint8_t[8] || node
{{ MemoryLocationTableRow | name= | offset=0x10 | value= | type=UInt32 | description=If value at <code>0x04</code> is non-zero then this will be, too. }}
|-
|}
{{ MemoryLocationTableRow | name= | offset=0x14 | value= | type=UInt32 | description=Audio data size. }}‎
 
== RwaUniqueID ==
{| class="wikitable" style=text-align:left
! Offset
! Type
! Name
|-
| 0x00 || RwaUUID* || uuid
{{ MemoryLocationTableRow | name= | offset=0x18 | type=byte[128] | value=<div style="text-align:center">0x73F2018B75DFF0814BC8E45F453A2D04 (Xbox)<br>0x‎‎‎‎5393C7DBEA6481AE4917FC38AAEAC9AC (PS2)</div> | description=Platform UUID. }}
|-
| 0x04 || char* || name
{{ MemoryLocationTableRow | name= | offset=0x28 | value= | type=UInt32 | description=Audio data position. }}
|-
| 0x08 || uint32_t || flags
! colspan="5" | Wave Dictionary
|-
|}
{{ MemoryLocationTableRow | offset=0x2C | name=uniqueID | type=RwaUniqueID | value= | description= }}
 
== RwaWaveDict ==
{| class="wikitable" style=text-align:left
! Offset
! Type
! Name
|-
| 0x00 || RwaUniqueID || uniqueID
{{ MemoryLocationTableRow | offset=0x38 | name=waveListHead | type=RwaLLNode | value= | description= }}
|-
| 0x0C || RwaLLNode || waveListHead
{{ MemoryLocationTableRow | offset=0x44 | name=pad | type=byte[2] | value= | description= }}
|-
| 0x18 || int8_t || flagsAux
{{ MemoryLocationTableRow | offset=0x46 | name=flagsAux | type=RwUInt8 | value= | description= }}
|-
| 0x19 || int8_t || flags
{{ MemoryLocationTableRow | offset=0x47 | name=flags | type=RwUInt8 | value= | description= }}
|-
| 0x1C || RwLLLink || link
{{ MemoryLocationTableRow | offset=0x48 | name=link | type=RwLLLink | value= | description= }}
|-
| 0x24 || void* || dumpAddr
{{ MemoryLocationTableRow | offset=0x50 | name=dumpAddr | type=void* | value= | description= }}
|-
| 0x28 || void* || waveRAMHandle
{{ MemoryLocationTableRow | offset=0x54 | name=waveRAMHandle | type=void* | value= | description= }}
|-
| 0x2C || void* || waveRAMSize
{{ MemoryLocationTableRow | offset=0x58 | name=waveRAMSize | type=RwUInt32 | value= | description= }}
|-
|}
! colspan="5" | <br> <!-- TODO: wtf is this called -->
 
== RwaWaveFormat ==
{| class="wikitable" style=text-align:left
! Offset
! Type
! Name
! Description
|-
| 0x00 || uint32_t || sampleRate ||
{{ MemoryLocationTableRow | offset=0x5C | name= | value= | type=char[] | description=Name of the AWD.<br>Size between 1 and 12 characters.<br>Padded to the nearest 4-byte boundary. }}
|-
| 0x04 || uint32_t || dataType || 0: Sony PS ADPCM<br>1: Signed 16-bit PCM<br>3: Nintendo DSP ADPCM<br>4: Xbox IMA ADPCM
{{ MemoryLocationTableRow | offset= | name= | value= | type=RwLinkList<RwaLLNode> | description=Node data is of type <code>RwaWave</code> (see below.) }}
|-
| 0x08 || uint32_t || length ||
|-
| 0x0C || uint8_t || bitDepth ||
|-
| 0x0D || uint8_t || noChannels ||
|-
| 0x10 || void* || miscData || Has a "00: GCN ADPCM Header" chunk which contains Nintendo DSP ADPCM coefficients and initial history data.
|-
| 0x14 || uint32_t || miscDataSize ||
|-
| 0x18 || uint8_t || flags ||
|-
| 0x19 || uint8_t || reserved ||
|-
|}
 
== RwaWave ==
Each wave is of type <code>RwaWave</code>, stored in a <code>RwLLNode</code> in the <code>RwLinkList</code>. In the AWD are of type , and are serialized as below:
{| class="wikitable" style=text-align:left
! Offset
! Type
! Name
! Type
! Value
! Description
|-
{{ MemoryLocationTableRow | offset=0x00 | name=uniqueID | type=RwaUniqueID | value= | description= }}uniqueID
|-
| 0x0C || RwaWaveDef* || waveDef
{{ MemoryLocationTableRow | offset=0x0C | name=waveDef | type=RwaWaveDef* | value= | description=Pointer to location in system memory. }}
|-
| 0x10 || RwaWaveFormat || format
{{ MemoryLocationTableRow | offset=0x10 | name=format | type=[[Wave Dictionary#RwaWaveFormat|RwaWaveFormat]] | value= | description= }}
|-
| 0x2C || RwaWaveFormat || targetFormat
{{ MemoryLocationTableRow | offset=0x2C | name=targetFormat | type=RwaWaveFormat | value= | description= Usually identical to <code>format</code>. }}
|-
| 0x48 || uint32_t || uncompressedLength
{{ MemoryLocationTableRow | offset=0x48 | name=uncompressedLength | type=RwUInt32 | value= | description= }}
|-
{{ MemoryLocationTableRow | offset=0x4C | name=data| type=void* | value= | description= }}data
|-
{{ MemoryLocationTableRow | offset=0x50 | name=state | type=void* | value= | description= }}state
|-
| 0x54 || uint32_t || flags
{{ MemoryLocationTableRow | offset=0x54 | name=flags| type=RwUInt32 | value= | description= }}
|-
{{ MemoryLocationTableRow | offset=0x58 | name=obj | type=RwaObj* | value= | description= }}obj
|-
|}
 
This is followed by the <code>RwaLLNode</code>, the entry (of type <code>char[]</code>) and a 128-bit UUID.
 
[[Category:Formats_(Takedown-Dominator)]]
== RwaWaveFormat ==
<pre style="max-width: 15em">
struct RwaWaveFormat {
RwUInt32 sampleRate;
RwaUUID* dataType;
RwUInt32 length;
RwUInt8 bitDepth;
RwUInt8 noChannels;
unsigned char pad[2];
void* miscData;
RwUInt8 miscDataSize;
RwUInt8 flags;
RwUInt8 reserved;
};
</pre>