Difference between revisions of "BRSAR (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
m
(Finish)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Under-construction}}
+
== Overview ==
 
 
 
The '''BRSAR''' ('''B'''inary '''R'''evolution '''S'''ound '''AR'''chive) format is used to store sound effects and some music. It is used in [[Mario Kart Wii]], Super Smash Bros. Brawl, The Legend of Zelda: Skyward Sword and other games. An index list of the known values of the revo_kart.brsar file used in [[Mario Kart Wii]] can be found [[Filesystem/sound/revo_kart.brsar|here]].
 
The '''BRSAR''' ('''B'''inary '''R'''evolution '''S'''ound '''AR'''chive) format is used to store sound effects and some music. It is used in [[Mario Kart Wii]], Super Smash Bros. Brawl, The Legend of Zelda: Skyward Sword and other games. An index list of the known values of the revo_kart.brsar file used in [[Mario Kart Wii]] can be found [[Filesystem/sound/revo_kart.brsar|here]].
  
Line 34: Line 33:
 
| 0x24 || UInt32 || Size of the [[#FILE|FILE]] section.
 
| 0x24 || UInt32 || Size of the [[#FILE|FILE]] section.
 
|-
 
|-
| 0x28 || Byte[24] || Padding.
+
| 0x28 || colspan=2 {{Unknown|End of header}}
|-
 
| 0x40 || colspan=2 {{Unknown|End of header}}
 
 
|}
 
|}
  
Line 55: Line 52:
 
| 0x08 || UInt32 || Offset to file name table.
 
| 0x08 || UInt32 || Offset to file name table.
 
|-
 
|-
| 0x0C || UInt32 || Mask table offset 1
+
| 0x0C || UInt32 || Offset to Sound tree.
 
|-
 
|-
| 0x10 || UInt32 || Mask table offset 2
+
| 0x10 || UInt32 || Offset to Player tree.
 
|-
 
|-
| 0x14 || UInt32 || Mask table offset 3
+
| 0x14 || UInt32 || Offset to Group tree.
 
|-
 
|-
| 0x18 || UInt32 || Mask table offset 4
+
| 0x18 || UInt32 || Offset to Bank tree.
 
|-
 
|-
 
| 0x1C || colspan=2 {{Unknown|End of header}}
 
| 0x1C || colspan=2 {{Unknown|End of header}}
Line 76: Line 73:
 
|}
 
|}
  
==== SYMB Mask Table ====
+
==== SYMB String Table ====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || {{Unknown|'''Unknown.''' Type of mask?}}
+
| 0x00 || UInt32 || Root Index.
 
|-
 
|-
| 0x04 || UInt32 || Number of entries
+
| 0x04 || UInt32 || Number of entries ('''N''')
 +
|-
 +
| 0x08 || [[#SYMB String Tree Node|TreeNode]]['''N'''] || Entries.
 
|}
 
|}
  
==== SYMB Mask Entry ====
+
==== SYMB String Tree Node ====
Information about this is unknown at this time.
+
{| class="wikitable"
 +
|-
 +
! Offset !! Type !! Description
 +
|-
 +
| 0x00 || UInt16 || Flags (0x01 = Leaf Node)
 +
|-
 +
| 0x02 || UInt16 || {{Unknown-left|'''Bit flag'''. Meaning unknown}}
 +
|-
 +
| 0x04 || UInt32 || Left Index.
 +
|-
 +
| 0x08 || UInt32 || Right Index.
 +
|-
 +
| 0x0c || UInt32 || String Index.
 +
|-
 +
| 0x10 || UInt32 || Index.
 +
|}
  
 
=== INFO ===
 
=== INFO ===
Line 100: Line 114:
 
| 0x04 || UInt32 || Size of the INFO section.
 
| 0x04 || UInt32 || Size of the INFO section.
 
|-
 
|-
| 0x08 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x08 || [[#Data Reference|DataRef]] || Reference to [[#Sound Data Table|Sound Data Table]]
|-
 
| 0x0C || UInt32 || Offset to the sound data table.
 
|-
 
| 0x10 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x14 || UInt32 || Offset to the [[BRBNK (File Format)|soundbank]] table.
 
 
|-
 
|-
| 0x18 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x10 || [[#Data Reference|DataRef]] || Reference to [[#Soundbank Table|Soundbank Table]]
 
|-
 
|-
| 0x1C || UInt32 || Offset to the player info table.
+
| 0x18 || [[#Data Reference|DataRef]] || Reference to [[#Player Info Table|Player Info Table]]
 
|-
 
|-
| 0x20 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x20 || [[#Data Reference|DataRef]] || Reference to [[#Collection Table|Collection Table]]
 
|-
 
|-
| 0x24 || UInt32 || Offset to the collection table.
+
| 0x28 || [[#Data Reference|DataRef]] || Reference to [[#Group Table|Group Table]]
 
|-
 
|-
| 0x28 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x30 || [[#Data Reference|DataRef]] || Reference to [[#Sound Count Table|Sound Count Table]]
|-
 
| 0x2C || UInt32 || Offset to the group table.
 
|-
 
| 0x30 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x34 || UInt32 || Offset to the Sound Count table.
 
 
|-
 
|-
 
| 0x38 || colspan=2 {{Unknown|End of header}}
 
| 0x38 || colspan=2 {{Unknown|End of header}}
Line 133: Line 135:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries ('''N''')
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| '''N''' * 8 + 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Sound Data Entry|Sound Data Entries]].
|-
 
| '''N''' * 8 + 0x08 || UInt32 || Offset to entry
 
 
|}
 
|}
  
Line 151: Line 151:
 
| 0x08 || UInt32 || PlayerID
 
| 0x08 || UInt32 || PlayerID
 
|-
 
|-
| 0x0C || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x0C || [[#Data Reference|DataRef]] || Reference to [[#Sound 3D Parameters|Sound3DParam]]
|-
 
| 0x10 || UInt32 || Offset to third subsection.
 
 
|-
 
|-
 
| 0x14 || Byte || Volume
 
| 0x14 || Byte || Volume
Line 166: Line 164:
 
| 0x17 || Byte || RemoteFilter
 
| 0x17 || Byte || RemoteFilter
 
|-
 
|-
| 0x18 || Byte || {{Unknown|'''Unknown.'''}}
+
| 0x18 || [[#Data Reference|DataRef]] || Reference to sound info.<br>'''Data type''' specifies sound:
|-
+
* 0x1 = [[#RSEQ|SEQ]]
| 0x19 || Byte || Section Control Type.
+
* 0x2 = [[#RSTM|STRM]]
The value that you set this to determines what section's settings the entry will use:
+
* 0x3 = [[#RWSD|WAVE]]
* 0x1 = SEQ Params
 
* 0x2 = STRM Params
 
* 0x3 = WAVE Params
 
|-
 
| 0x1C || UInt32 || Offset to second subsection
 
 
|-
 
|-
 
| 0x20 || UInt32 || UserParam1
 
| 0x20 || UInt32 || UserParam1
Line 197: Line 190:
 
| 0x2A || Byte || ActorPlayerID
 
| 0x2A || Byte || ActorPlayerID
 
|-
 
|-
| 0x2B || Byte || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x2B || Byte || {{Unknown|Reserved.}}
 
|}
 
|}
  
Line 210: Line 203:
 
| 0x04 || UInt32 || Soundbank index
 
| 0x04 || UInt32 || Soundbank index
 
|-
 
|-
| 0x08 || Byte[3] || {{Unknown|'''Unknown.'''}}
+
| 0x08 || UInt32 || RSEQAllocTrack
 +
|-
 +
| 0x0C || Byte || SeqChannelPriority
 
|-
 
|-
| 0x0B || Byte || RSEQAllocTrack
+
| 0x0D || Byte || Release priority fix flag
 
|-
 
|-
| 0x0C || Byte || SeqChannelPriority
+
| 0x0E || Byte[2] || {{Unknown-left|Padding}}
 
|-
 
|-
| 0x0D || Byte[7] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x10 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
Line 226: Line 221:
 
| 0x00 || UInt32 || SoundDataNode
 
| 0x00 || UInt32 || SoundDataNode
 
|-
 
|-
| 0x04 || Byte[3] || {{Unknown|'''Unknown.'''}}
+
| 0x04 || UInt32 || RWSDAllocTrack
 
|-
 
|-
| 0x07 || Byte || RWSDAllocTrack
+
| 0x08 || Byte || Channel Priority
 
|-
 
|-
| 0x08 || Byte || ChanelPriority
+
| 0x09 || Byte || Release priority fix flag
 +
|-
 +
| 0x0A || Byte[2] || {{Unknown-left|Padding}}
 
|-
 
|-
| 0x09 || Byte[7] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0C || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
Line 244: Line 241:
 
| 0x04 || UInt16 || AllocChannelCount
 
| 0x04 || UInt16 || AllocChannelCount
 
|-
 
|-
| 0x06 || UInt16 || RSTMAllocTrack
+
| 0x06 || UInt16 || AllocTrackFlag
 
|-
 
|-
| 0x08 || UInt32 || {{Unknown|'''Unknown.'''}}
+
| 0x08 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
==== Sound Data Subsection 3 ====
+
==== Sound 3D Parameters ====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 256: Line 253:
 
| 0x00 || UInt32 || Sound3DParam flags
 
| 0x00 || UInt32 || Sound3DParam flags
 
|-
 
|-
| 0x04 || Byte || DecayCurve
+
| 0x04 || Byte || Decay Curve (1 = Logarithmic, 2 = Linear)
 
|-
 
|-
| 0x05 || Byte || DecayRatio
+
| 0x05 || Byte || Decay Ratio
 
|-
 
|-
| 0x06 || Byte[6] || {{Unknown|'''Unknown.'''}}
+
| 0x06 || Byte || Doppler Factor
 +
|-
 +
| 0x07 || Byte || {{Unknown-left|Padding}}
 +
|-
 +
| 0x08 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
Line 268: Line 269:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries ('''N''')
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| '''N''' * 8 + 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Soundbank Entry|Soundbank Entries]].
|-
 
| '''N''' * 8 + 0x08 || UInt32 || Offset to the entry
 
 
|}
 
|}
  
Line 292: Line 291:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Player Info Entry|Player Info Entries]].
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
Line 314: Line 305:
 
| 0x04 || Byte || Playable Sound Count
 
| 0x04 || Byte || Playable Sound Count
 
|-
 
|-
| 0x05 || Byte[11] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x05 || Byte || {{Unknown-left|Padding}}
 +
|-
 +
| 0x06 || UInt16 || {{Unknown-left|Padding}}
 +
|-
 +
| 0x08 || UInt32 || Heap Size
 +
|-
 +
| 0x0C || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
 
=== Collection Table ===
 
=== Collection Table ===
This section controls the BRSAR indexes shown in [[BrawlBox]].
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 324: Line 320:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Collection Entry|Collection Entries]].
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
Line 348: Line 336:
 
| 0x08 || Int32 || Entry number (always -1)
 
| 0x08 || Int32 || Entry number (always -1)
 
|-
 
|-
| 0x0C || Byte || Enable next offset
+
| 0x0C || [[#Data Reference|DataRef]] || Reference to external file name.
|-
 
| 0x0D || Byte[3] || Padding
 
|-
 
| 0x10 || UInt32  || Offset to the external file name in the case of external files. Usually follows this structure if present.
 
|-
 
| 0x14|| Byte || Enable next offset
 
 
|-
 
|-
| 0x15|| Byte[3] || Padding
+
| 0x14|| [[#Data Reference|DataRef]] || Reference to [[#Collection Position Table|Collection Position Table]].
|-
 
| 0x18 || UInt32 || Collection position table offset. Usually follows this structure if present.
 
 
|}
 
|}
  
Line 366: Line 346:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x04 || Byte || Enable next offset
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Collection Position Entry|Collection Position Entries]].
|-
 
| 0x05 || Byte[3] || Padding
 
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x0C || Byte || Enable next offset
 
|-
 
| 0x0D || Byte[3] || Padding
 
|-
 
| 0x10 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
Line 392: Line 360:
 
| 0x04 || UInt32 || Index within group
 
| 0x04 || UInt32 || Index within group
 
|}
 
|}
 
  
 
=== Group Table ===
 
=== Group Table ===
Line 399: Line 366:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Group Data Entry|Group Data Entries]].
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
Line 417: Line 376:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || File name index
+
| 0x00 || UInt32 || File name index.
 
|-
 
|-
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0xFFFFFFF}}
+
| 0x04 || UInt32 || Entry Number.
 
|-
 
|-
| 0x08 || Byte[8] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x08 || [[#Data Reference|DataRef]] || Reference to external filepath string.
 
|-
 
|-
 
| 0x10 || UInt32 || Offset to the RSEQ, RBNK, or RWSD file.
 
| 0x10 || UInt32 || Offset to the RSEQ, RBNK, or RWSD file.
Line 431: Line 390:
 
| 0x1C || UInt32 || Size of the RWAR or DSP file.
 
| 0x1C || UInt32 || Size of the RWAR or DSP file.
 
|-
 
|-
| 0x20 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x20 || [[#Data Reference|DataRef]] || Reference to [[#Group Item Reference Table|Group Item Reference Table]].
 +
|}
 +
 
 +
==== Group Item Reference Table ====
 +
{| class="wikitable"
 
|-
 
|-
| 0x24 || UInt32 || Offset to the second subsection. Usually follows this value anyway.
+
! Offset !! Type !! Description
|-
 
| 0x28 || UInt32 || Number of entries in the subsection. All data after this is absent if this is 0x00.
 
|-
 
| 0x2C || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
 
|-
 
|-
| 0x30 || UInt32 || Offset to the first entry
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x34 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to the [[#Group Item Info Entry|Group Item Info Entries]].
|-
 
| 0x38 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
==== Subsection 2 Entry ====
+
==== Group Item Info Entry ====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 463: Line 418:
 
| 0x10 || UInt32 || Size of the audio data.
 
| 0x10 || UInt32 || Size of the audio data.
 
|-
 
|-
| 0x14 || UInt32 || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x14 || UInt32 || {{Unknown-left|Reserved.}}
 
|}
 
|}
  
Line 477: Line 432:
 
| 0x04 || UInt16 || StrmSoundCount
 
| 0x04 || UInt16 || StrmSoundCount
 
|-
 
|-
| 0x04 || UInt16 || StrmTrackCount
+
| 0x06 || UInt16 || StrmTrackCount
 
|-
 
|-
| 0x06 || UInt16 || WaveSoundCount
+
| 0x08 || UInt16 || StrmChannelCount
 
|-
 
|-
| 0x08 || UInt16 || WaveTrackCount
+
| 0x0A || UInt16 || WaveSoundCount
 
|-
 
|-
| 0x0A || Byte[20] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0C || UInt16 || WaveTrackCount
 +
|-
 +
| 0x0E || UInt16 || {{Unknown-left|Padding.}}
 +
|-
 +
| 0x10 || UInt32 || {{Unknown-left|Reserved.}}
 
|}
 
|}
  
Line 499: Line 458:
 
| 0x0C || &ndash; || File data
 
| 0x0C || &ndash; || File data
 
|-
 
|-
 +
|}
 +
 +
=== Data Reference ===
 +
The '''Data Reference''' structure is used to point to other data types.
 +
{| class="wikitable"
 +
|-
 +
! Offset !! Type !! Description
 +
|-
 +
| 0x00 || Byte || '''Reference type'''. (0 = Address, 1 = Offset).
 +
|-
 +
| 0x01 || Byte || Data type. Usually 0x00.
 +
|-
 +
| 0x02 || UInt16 || {{Unknown-left|Reserved.}}
 +
|-
 +
| 0x04 || UInt32 || Value.
 
|}
 
|}
  

Latest revision as of 11:42, 15 May 2023

Overview

The BRSAR (Binary Revolution Sound ARchive) format is used to store sound effects and some music. It is used in Mario Kart Wii, Super Smash Bros. Brawl, The Legend of Zelda: Skyward Sword and other games. An index list of the known values of the revo_kart.brsar file used in Mario Kart Wii can be found here.

File Header

The file begins with a header of size 0x40 bytes.

Offset Type Description
0x00 String File magic. RSAR in ASCII.
0x04 UInt16 Byte order mark (BOM): The value is always 0xFEFF. If value 0xFFFE is read, then the false endian is used. Mario Kart Wii uses nearly always big endian (bytes 0xFE,0xFF).
0x06 UInt16 Version of the file format. "revo_kart.brsar" uses 01 04. "HomeButtonSe.brsar" (used for the Home Menu) uses 01 01.
0x08 UInt32 Length of the file.
0x0C UInt16 Length of the header (always 0x40).
0x0E UInt16 Number of sections.
0x10 UInt32 Offset to the SYMB section.
0x14 UInt32 Size of the SYMB section.
0x18 UInt32 Offset to the INFO section.
0x1C UInt32 Size of the INFO section.
0x20 UInt32 Offset to the FILE section.
0x24 UInt32 Size of the FILE section.
0x28 End of header

Sections

Unless otherwise noted, offsets in each section are relative to the start of the section block, plus 0x8.

SYMB

The SYMB section consists of an FST-like data structure. It contains 3 header-less subsections.

Offset Type Description
0x00 String Section magic. SYMB in ASCII.
0x04 UInt32 Size of the SYMB section.
0x08 UInt32 Offset to file name table.
0x0C UInt32 Offset to Sound tree.
0x10 UInt32 Offset to Player tree.
0x14 UInt32 Offset to Group tree.
0x18 UInt32 Offset to Bank tree.
0x1C End of header

SYMB File Name Table

Offset Type Description
0x00 UInt32 Number of entries (N)
0x04 UInt32[N] Offset to file name

SYMB String Table

Offset Type Description
0x00 UInt32 Root Index.
0x04 UInt32 Number of entries (N)
0x08 TreeNode[N] Entries.

SYMB String Tree Node

Offset Type Description
0x00 UInt16 Flags (0x01 = Leaf Node)
0x02 UInt16 Bit flag. Meaning unknown
0x04 UInt32 Left Index.
0x08 UInt32 Right Index.
0x0c UInt32 String Index.
0x10 UInt32 Index.

INFO

The INFO section contain parameters about the sounds in a BRSAR.

Offset Type Description
0x00 String Section magic. INFO in ASCII.
0x04 UInt32 Size of the INFO section.
0x08 DataRef Reference to Sound Data Table
0x10 DataRef Reference to Soundbank Table
0x18 DataRef Reference to Player Info Table
0x20 DataRef Reference to Collection Table
0x28 DataRef Reference to Group Table
0x30 DataRef Reference to Sound Count Table
0x38 End of header

Sound Data Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Sound Data Entries.

Sound Data Entry

Offset Type Description
0x00 UInt32 File name index
0x04 UInt32 File collection index
0x08 UInt32 PlayerID
0x0C DataRef Reference to Sound3DParam
0x14 Byte Volume
0x15 Byte PlayerPriority
0x16 Byte SoundType:
  • 0x1 = SEQ
  • 0x2 = STRM
  • 0x3 = WAVE
0x17 Byte RemoteFilter
0x18 DataRef Reference to sound info.
Data type specifies sound:
0x20 UInt32 UserParam1
0x24 UInt32 UserParam2
0x28 Byte PanMode:
  • 0x0 = Dual
  • 0x1 = Balance
0x29 Byte PanCurve:
  • 0x0 = Sqrt
  • 0x1 = Sqrt0DB
  • 0x2 = Sqrt0DBClamp
  • 0x3 = SinCos
  • 0x4 = SinCos0DB
  • 0x5 = SinCos0DBClamp
  • 0x6 = Linear
  • 0x7 = Linear0DB
  • 0x8 = Linear0DBClamp
0x2A Byte ActorPlayerID
0x2B Byte Reserved.

Sound Data Subsection 2

RSEQ
Offset Type Description
0x00 UInt32 SeqLabelEntry
0x04 UInt32 Soundbank index
0x08 UInt32 RSEQAllocTrack
0x0C Byte SeqChannelPriority
0x0D Byte Release priority fix flag
0x0E Byte[2] Padding
0x10 UInt32 Reserved
RWSD
Offset Type Description
0x00 UInt32 SoundDataNode
0x04 UInt32 RWSDAllocTrack
0x08 Byte Channel Priority
0x09 Byte Release priority fix flag
0x0A Byte[2] Padding
0x0C UInt32 Reserved
RSTM
Offset Type Description
0x00 UInt32 Start Position
0x04 UInt16 AllocChannelCount
0x06 UInt16 AllocTrackFlag
0x08 UInt32 Reserved

Sound 3D Parameters

Offset Type Description
0x00 UInt32 Sound3DParam flags
0x04 Byte Decay Curve (1 = Logarithmic, 2 = Linear)
0x05 Byte Decay Ratio
0x06 Byte Doppler Factor
0x07 Byte Padding
0x08 UInt32 Reserved

Soundbank Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Soundbank Entries.

Soundbank Entry

Offset Type Description
0x00 UInt32 File name index
0x04 UInt32 File collection index
0x08 UInt32 Bank index

Player Info Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Player Info Entries.

Player Info Entry

Offset Type Description
0x00 UInt32 File name index
0x04 Byte Playable Sound Count
0x05 Byte Padding
0x06 UInt16 Padding
0x08 UInt32 Heap Size
0x0C UInt32 Reserved

Collection Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Collection Entries.

Collection Entry

Offset Type Description
0x00 UInt32 Length of the RBNK, RSEQ, or RWAV file except the audio data. Length of the entire file for external files.
0x04 UInt32 Length of the audio data. Null for RSEQ or external files.
0x08 Int32 Entry number (always -1)
0x0C DataRef Reference to external file name.
0x14 DataRef Reference to Collection Position Table.

Collection Position Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Collection Position Entries.

Collection Position Entry

Offset Type Description
0x00 UInt32 Group index
0x04 UInt32 Index within group

Group Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to Group Data Entries.

Group Data Entry

Offset Type Description
0x00 UInt32 File name index.
0x04 UInt32 Entry Number.
0x08 DataRef Reference to external filepath string.
0x10 UInt32 Offset to the RSEQ, RBNK, or RWSD file.
0x14 UInt32 Size of the RSEQ, RBNK, or RWSD file.
0x18 UInt32 Offset to the RWAR or DSP file.
0x1C UInt32 Size of the RWAR or DSP file.
0x20 DataRef Reference to Group Item Reference Table.

Group Item Reference Table

Offset Type Description
0x00 UInt32 N = Number of entries.
0x04 DataRef[N] References to the Group Item Info Entries.

Group Item Info Entry

Offset Type Description
0x00 UInt32 Group index
0x04 UInt32 Offset to the file, relative to the value at 0x14 of the main entry.
0x08 UInt32 Size of the file.
0x0C UInt32 Offset to the audio data, relative to the value at 0x1C of the main entry.
0x10 UInt32 Size of the audio data.
0x14 UInt32 Reserved.

Sound Count Table

Offset Type Description
0x00 UInt16 SeqSoundCount
0x02 UInt16 SeqTrackCount
0x04 UInt16 StrmSoundCount
0x06 UInt16 StrmTrackCount
0x08 UInt16 StrmChannelCount
0x0A UInt16 WaveSoundCount
0x0C UInt16 WaveTrackCount
0x0E UInt16 Padding.
0x10 UInt32 Reserved.

FILE

Offset Type Description
0x00 String Section magic. FILE in ASCII.
0x04 UInt32 Size of the FILE section.
0x08 Byte[24] Padding
0x0C File data

Data Reference

The Data Reference structure is used to point to other data types.

Offset Type Description
0x00 Byte Reference type. (0 = Address, 1 = Offset).
0x01 Byte Data type. Usually 0x00.
0x02 UInt16 Reserved.
0x04 UInt32 Value.

Tools

The following tools can handle BRSAR files:

Links

All about BRRES files

BRRES fileIndex GroupSub Files

CHR0CLR0MDL0PAT0SCN0SHP0SRT0TEX0