WSYS: Difference between revisions

From Luma's Workshop
Jump to navigation Jump to search
(Created page with "== WSYS Header == {| class="wikitable" |- ! Offset ! Type ! Description ! Notes |- | 0x00 | String[4] | WSYS (0x57535953) | |- | 0x04 | UInt32 | File size | |- | 0x08 | Byte[3] | ? | |- | 0x0B | UInt8 | Bank ID | |- | 0x0C | Byte[4] | ? | |- | 0x10 | UInt32 | Offset to WINF Section relative to file beginning. | |- | 0x14 | UInt32 | Offset to WBCT Section relative to file beginning. | |- | 0x18 | Byte[8] | Padding? | |- | 0x20 | | Start of first AW Definition Se...")
 
(correct wsys juice)
Line 1: Line 1:
== WSYS Header ==
'''WSYS''' Wave System
{| class="wikitable"  
 
Internally, Wave System.
 
This section contains all of the information required for decoding the [[AW|AW File]] as well as other information for melodic tuning, root key, and other various parts of JAudio.
 
Great part about WSYS is it doesn't matter what version of JAudio you're running. The WSYS format never changed between engine versions (minus the wave count int, but that doesn't matter because older versions just ignore it!)
 
__TOC__
 
<h1>WSYS Structure</h1>
 
{| class="wikitable"
|-
|-
! Offset
! Offset               !! Type !! Name !! Description
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x00</center> || int32 || 0x57535953 'WSYS' || Magic
| String[4]
| WSYS (0x57535953)
|  
|-
|-
| 0x04
| <center>0x04</center> || int32 || size || WSYS Size
| UInt32
| File size
|  
|-
|-
| 0x08
| <center>0x08</center> || int32 || wsysID || WSYS ID (This is how insts select the wsys)
| Byte[3]
| ?
|  
|-
|-
| 0x0B
| <center>0x0C</center> || int32 || waveCount || WSYS Wave Count
| UInt8
| Bank ID
|  
|-
|-
| 0x0C
| <center>0x10</center> || int32 || [[WSYS#WINF | WINF Pointer]] || WBINF
| Byte[4]
| ?
|  
|-
|-
| 0x10
| <center>0x14</center> || int32 || [[WSYS#WINF | WBCT Pointer]] || WBCT
| UInt32
| Offset to WINF Section relative to file beginning.
|  
|-
|-
| 0x14
| UInt32
| Offset to WBCT Section relative to file beginning.
|
|-
| 0x18
| Byte[8]
| Padding?
|
|-
| 0x20
|
| Start of first AW Definition Section.
|
|}
|}
==WINF==
WINF is a pointer container. They point to the [[WSYS#WaveGroup|Wave Groups]].
The ID's for every wave group are controlled by the [[WSYS#SCNE|SCNE]] object. They line up,  WaveGroup[1] uses WaveScenes[1]


== AW Definition Section ==
{| class="wikitable"
{| class="wikitable"  
|-
|-
! Offset
! Offset               !! Type !! Name !! Description
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x00</center> || int32 || 0x57494E46 'WINF' || Magic
|  
| First '''AW Entry Section'''.
| Only holds AW filename if the AW file is empty.
|-
|-
| '''N'''*0x2C
| <center>0x04</center> || int32 || waveGroupCount || Count of wavegroups
| String[0x70]
| AW filename
|  
|-
|-
| '''N'''*0x2C+0x70
| <center>0x08</center> ||  [[WSYS#WaveGroup|WaveGroup]]*[] (int32) || waveGroupPointers || Pointers to the individual wavegroups.
| UInt32
| Amount '''N''' of AW Entry Offsets
|  
|-
|-
| '''N'''*0x2C+0x74
 
|
| Start of AW Entry Offsets
|
|}
|}


=== AW Entry Offset ===
{| class="wikitable"
|-
! Offset
! Type
! Description
! Notes
|-
| 0x00
| UInt32
| Offset to AW Entry Section relative to file beginning.
|
|}


=== AW Entry Section (size 0x2C) ===
==SCNE==
{| class="wikitable"  
SCNE is a pointer container as well. They point to the [[WSYS#C-DF|C-DF]] objects.
 
 
{| class="wikitable"
|-
|-
! Offset
! Offset               !! Type !! Name !! Description
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x00</center> || int32 || 0x53434E45 'SCNE' || Magic
| UInt16
| ?
|  
|-
|-
| 0x02
| <center>0x04</center> || int64 || padding || padding
| UInt16
| ?
|  
|-
|-
| 0x04
| <center>0x0C</center> || int32 || [[WSYS#C-DF|C-DF]]* || Pointer to C-DF
| Float
| Sample rate
|  
|-
|-
| 0x08
| <center>0x10</center> || int32 || [[WSYS#C-DF|C-DF]]* || Pointer to C-EX
| UInt32
| Offset of sound data in AW file
|  
|-
|-
| 0x0C
| <center>0x14</center> || int32 || [[WSYS#C-DF|C-DF]]* || Pointer to C-ST
| UInt32
| Size of sound data in AW file
|  
|-
|-
| 0x10
 
| UInt32
|}
| Is loop?
 
| 0x00000000 if no loop, 0xFFFFFFFF if loop
==Scene Waves==
 
Note: The other sections C-ST, and C-EX point to to this category as well. They remain empty. Code for parsing them isn't even in the executables.
 
{| class="wikitable"
|-
|-
| 0x14
! Offset                !! Type !! Name !! Description
| UInt32
| Loop start sample
|
|-
|-
| 0x18
| <center>0x00</center> || int32 || 0x432D4446 ('C-DF') || Magic
| UInt32
| Loop end sample
|  
|-
|-
| 0x1C
| <center>0x04</center> || int32 || wavesCount || Wave Count
| UInt32
| Total samples
|  
|-
|-
| 0x20
| <center>0x08</center> || int32 || [[WSYS#WAVEID|WAVEID]]*[] || Pointer array waveID's
| Int16
| Last
|  
|-
|-
| 0x22
 
| Int16
| Penult
|
|-
| 0x24
| Byte[7]
| ?
|
|-
| 0x2B
| Byte[1]
| ?
|
|}
|}


== WINF Section ==
 
{| class="wikitable"  
 
==WAVEID==
 
{| class="wikitable"
|-
|-
! Offset
! Offset               !! Type !! Name !! Description
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x00</center> || int16 || waveGroupID || Wave Group ID (Current WSYS)
| String[4]
| WINF (0x57494E46)
|
|-
|-
| 0x04
| <center>0x02</center> || int16 || waveID || The ID assigned from this wave
| UInt32
| Amount '''N''' of entries
|  
|-
|-
| 0x08
 
|
| Start of entries
|
|}
|}


=== WINF entry ===
{| class="wikitable"
|-
! Offset
! Type
! Description
! Notes
|-
| 0x00
| UInt32
| Offset to AW filename relative to file beginning.
|
|}


== Wave Link Section ==


=== Wave ID Section ===
==WaveGroup==
{| class="wikitable"  
SCNE is a pointer container as well. They point to the [[WSYS#C-DF|C-DF]] objects.
|-
 
! Offset
 
! Type
{| class="wikitable"
! Description
! Notes
|-
|-
| 0x00
! Offset                !! Type !! Name !! Description
|
| First Wave ID Definition
|
|}
 
==== Wave ID Definition (size 0x38) ====
{| class="wikitable"
|-
|-
! Offset
| <center>0x00</center> || char[0x70] || archiveName || File Path for .AW
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x70</center> || int32|| wavesCount || Wave Count
| UInt32
| '''Wave ID'''
|
|-
|-
| 0x04
| <center>0x74</center> || int32 || [[WSYS#WAVE|WAVE]]*[] || Pointer array of Waves
| Byte[0x30]
| ?
|  
|-
|-
| 0x34
| Byte[4]
| 0xFFFFFFFF
|
|}


=== C-DF Section ===
{| class="wikitable"
|-
! Offset
! Type
! Description
! Notes
|-
| 0x00
| String[4]
| C-DF (0x432D4446)
|
|-
| 0x04
| UInt32
| Amount '''N''' of entries
|
|-
| 0x08
|
| Start of entries
|
|}
|}


==== C-DF entry ====
{| class="wikitable"
|-
! Offset
! Type
! Description
! Notes
|-
| 0x00
| UInt32
| Offset to Wave ID Definition relative to file beginning.
|
|}


First C-DF Section might belong to first AW Definition Section, thus first '''Wave ID''' belongs to first AW Entry.
==WAVE==


=== C-EX Section ===
Container format for Wave Information. This tells you where the ADPCM / PCM / whatever data starts inside of the .AW file for the current group and for what wave.
?


=== C-ST Section ===
?


=== SCNE Section ===
{| class="wikitable"
{| class="wikitable"  
|-
|-
! Offset
! Offset               !! Type !! Name !! Description
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x00</center> || byte || 0x00 || unknown
| String[4]
| SCNE (0x53434E45)
|  
|-
|-
| 0x04
| <center>0x01</center> || byte || format || WaveFormat
| Byte[8]
| ?
|  
|-
|-
| 0x0C
| <center>0x02</center> || byte || baseKey || Base Key
| UInt32
| Offset to C-DF Section relative to file beginning.
|  
|-
|-
| 0x10
| <center>0x03</center> || byte || 0x00 || unknown
| UInt32
| Offset to C-EX Section relative to file beginning.
|  
|-
|-
| 0x14
| <center>0x04</center> || float || sampleRate || Sample Rate
| UInt32
| Offset to C-ST Section relative to file beginning.
|  
|-
|-
| 0x18
| <center>0x08</center> || int32 || awOfsStart || AW Offset Start
| Byte[8]
|-
| Padding?
| <center>0x0C</center> || int32 || awOfsEnd || AW Length
|  
|}
 
== WBCT Section ==
{| class="wikitable"
|-
|-
! Offset
| <center>0x10</center> || int32(bool) || loop || Loop flags?
! Type
! Description
! Notes
|-
|-
| 0x00
| <center>0x14</center> || int32 || loopStartSample || Loop Start Sample
| String[4]
| WBCT (0x57424354)
|  
|-
|-
| 0x04
| <center>0x18</center> || int32 || loopEndSample || Loop End Sample
| UInt32
| ?
|  
|-
|-
| 0x08
| <center>0x20</center> || int32 || sampleCount || Samples Count
| UInt32
| Amount '''N''' of entries
|  
|-
|-
| 0x0C
| <center>0x24</center> || short || pLast || ADPCM Loop Last Sample
|  
| Start of entries
|  
|}
 
=== WBCT entry ===
{| class="wikitable"
|-
|-
! Offset
| <center>0x26</center> || short || pPenult || ADPCM Loop Penult Sample
! Type
! Description
! Notes
|-
|-
| 0x00
| UInt32
| Offset to SCNE Section relative to file beginning.
|
|}
|}

Revision as of 06:13, 29 May 2025

WSYS Wave System

Internally, Wave System.

This section contains all of the information required for decoding the AW File as well as other information for melodic tuning, root key, and other various parts of JAudio.

Great part about WSYS is it doesn't matter what version of JAudio you're running. The WSYS format never changed between engine versions (minus the wave count int, but that doesn't matter because older versions just ignore it!)

WSYS Structure

Offset Type Name Description
0x00
int32 0x57535953 'WSYS' Magic
0x04
int32 size WSYS Size
0x08
int32 wsysID WSYS ID (This is how insts select the wsys)
0x0C
int32 waveCount WSYS Wave Count
0x10
int32 WINF Pointer WBINF
0x14
int32 WBCT Pointer WBCT

WINF

WINF is a pointer container. They point to the Wave Groups.

The ID's for every wave group are controlled by the SCNE object. They line up, WaveGroup[1] uses WaveScenes[1]


Offset Type Name Description
0x00
int32 0x57494E46 'WINF' Magic
0x04
int32 waveGroupCount Count of wavegroups
0x08
WaveGroup*[] (int32) waveGroupPointers Pointers to the individual wavegroups.


SCNE

SCNE is a pointer container as well. They point to the C-DF objects.


Offset Type Name Description
0x00
int32 0x53434E45 'SCNE' Magic
0x04
int64 padding padding
0x0C
int32 C-DF* Pointer to C-DF
0x10
int32 C-DF* Pointer to C-EX
0x14
int32 C-DF* Pointer to C-ST

Scene Waves

Note: The other sections C-ST, and C-EX point to to this category as well. They remain empty. Code for parsing them isn't even in the executables.

Offset Type Name Description
0x00
int32 0x432D4446 ('C-DF') Magic
0x04
int32 wavesCount Wave Count
0x08
int32 WAVEID*[] Pointer array waveID's


WAVEID

Offset Type Name Description
0x00
int16 waveGroupID Wave Group ID (Current WSYS)
0x02
int16 waveID The ID assigned from this wave


WaveGroup

SCNE is a pointer container as well. They point to the C-DF objects.


Offset Type Name Description
0x00
char[0x70] archiveName File Path for .AW
0x70
int32 wavesCount Wave Count
0x74
int32 WAVE*[] Pointer array of Waves


WAVE

Container format for Wave Information. This tells you where the ADPCM / PCM / whatever data starts inside of the .AW file for the current group and for what wave.


Offset Type Name Description
0x00
byte 0x00 unknown
0x01
byte format WaveFormat
0x02
byte baseKey Base Key
0x03
byte 0x00 unknown
0x04
float sampleRate Sample Rate
0x08
int32 awOfsStart AW Offset Start
0x0C
int32 awOfsEnd AW Length
0x10
int32(bool) loop Loop flags?
0x14
int32 loopStartSample Loop Start Sample
0x18
int32 loopEndSample Loop End Sample
0x20
int32 sampleCount Samples Count
0x24
short pLast ADPCM Loop Last Sample
0x26
short pPenult ADPCM Loop Penult Sample