Difference between revisions of "BRSAR (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
(Completed the tables)
(Finish)
 
(32 intermediate revisions by 13 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]].
  
 
== File Header ==
 
== File Header ==
 
 
The file begins with a header of size 0x40 bytes.
 
The file begins with a header of size 0x40 bytes.
  
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
!Offset !! Type !! Description
 
!Offset !! Type !! Description
 
|-
 
|-
Line 35: 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}}
 
|-
 
 
|}
 
|}
  
 
== Sections ==
 
== Sections ==
 
 
Unless otherwise noted, offsets in each section are relative to the start of the section block, plus 0x8.
 
Unless otherwise noted, offsets in each section are relative to the start of the section block, plus 0x8.
  
 
=== SYMB ===
 
=== SYMB ===
 
 
The SYMB section consists of an FST-like data structure. It contains 3 header-less subsections.
 
The SYMB section consists of an FST-like data structure. It contains 3 header-less subsections.
  
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 59: 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 71: Line 64:
  
 
==== SYMB File Name Table ====
 
==== SYMB File Name Table ====
 +
{| class="wikitable"
 +
|-
 +
! Offset !! Type !! Description
 +
|-
 +
| 0x00 || UInt32 || Number of entries ('''N''')
 +
|-
 +
| 0x04 || UInt32['''N'''] || Offset to file name
 +
|}
  
 +
==== SYMB String Table ====
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries
+
| 0x00 || UInt32 || Root Index.
 
|-
 
|-
| 0x04 || Uint32 || Offset to the first file name
+
| 0x04 || UInt32 || Number of entries ('''N''')
 
|-
 
|-
| 0x08 || UInt32 || Offset to the second file name
+
| 0x08 || [[#SYMB String Tree Node|TreeNode]]['''N'''] || Entries.
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
==== SYMB Mask Table ====
+
==== SYMB String Tree Node ====
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || {{Unknown|'''Unknown.''' Type of mask?}}
+
| 0x00 || UInt16 || Flags (0x01 = Leaf Node)
 
|-
 
|-
| 0x04 || Uint32 || Number of entries
+
| 0x02 || UInt16 || {{Unknown-left|'''Bit flag'''. Meaning unknown}}
 
|-
 
|-
 +
| 0x04 || UInt32 || Left Index.
 +
|-
 +
| 0x08 || UInt32 || Right Index.
 +
|-
 +
| 0x0c || UInt32 || String Index.
 +
|-
 +
| 0x10 || UInt32 || Index.
 
|}
 
|}
 
==== SYMB Mask Entry ====
 
 
Information about this is unknown at this time.
 
  
 
=== INFO ===
 
=== INFO ===
 
 
The INFO section contain parameters about the sounds in a BRSAR.
 
The INFO section contain parameters about the sounds in a BRSAR.
  
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 113: 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 || [[#Data Reference|DataRef]] || Reference to [[#Soundbank Table|Soundbank Table]]
 
|-
 
|-
| 0x10 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x18 || [[#Data Reference|DataRef]] || Reference to [[#Player Info Table|Player Info Table]]
 
|-
 
|-
| 0x14 || UInt32 || Offset to the [[BRBNK (File Format)|soundbank]] table.
+
| 0x20 || [[#Data Reference|DataRef]] || Reference to [[#Collection Table|Collection Table]]
 
|-
 
|-
| 0x18 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x28 || [[#Data Reference|DataRef]] || Reference to [[#Group Table|Group Table]]
 
|-
 
|-
| 0x1C || UInt32 || Offset to the player info table.
+
| 0x30 || [[#Data Reference|DataRef]] || Reference to [[#Sound Count Table|Sound Count Table]]
 
|-
 
|-
| 0x20 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x38 || colspan=2 {{Unknown|End of header}}
|-
 
| 0x24 || UInt32 || Offset to the collection table.
 
 
|-
 
|-
| 0x28 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x30 || UInt32 || Offset to the group table.
 
|-
 
| 0x28 || UInt32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x34 || UInt32 || Offset to the Sound Count table.
 
|-
 
| 0x38 || colspan=2 {{Unknown|End of header}}
 
|-
 
 
|}
 
|}
  
 
==== Sound Data Table ====
 
==== Sound Data Table ====
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries-1.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Sound Data Entry|Sound 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 | '''...'''
 
 
|}
 
|}
  
 
==== Sound Data Entry ====
 
==== Sound Data Entry ====
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 0x00 || UInt32 || File name index
 
| 0x00 || UInt32 || File name index
 
|-
 
|-
| 0x04 || Uint32 || File index
+
| 0x04 || UInt32 || File collection index
 
|-
 
|-
| 0x08 || UInt32 || {{Unknown|'''Unknown.''' Padding?}}
+
| 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 180: Line 157:
 
| 0x15 || Byte || PlayerPriority
 
| 0x15 || Byte || PlayerPriority
 
|-
 
|-
| 0x16 || UInt16 || Flags
+
| 0x16 || Byte || SoundType:
 +
* 0x1 = SEQ
 +
* 0x2 = STRM
 +
* 0x3 = WAVE
 +
|-
 +
| 0x17 || Byte || RemoteFilter
 +
|-
 +
| 0x18 || [[#Data Reference|DataRef]] || Reference to sound info.<br>'''Data type''' specifies sound:
 +
* 0x1 = [[#RSEQ|SEQ]]
 +
* 0x2 = [[#RSTM|STRM]]
 +
* 0x3 = [[#RWSD|WAVE]]
 +
|-
 +
| 0x20 || UInt32 || UserParam1
 
|-
 
|-
| 0x18 || UInt32 || {{Unknown|'''Unknown.''' More flags? 0x19 seems to control section type of the second subsection.}}
+
| 0x24 || UInt32 || UserParam2
 
|-
 
|-
| 0x1C || UInt32 || Offset to second subsection
+
| 0x28 || Byte || PanMode:
 +
* 0x0 = Dual
 +
* 0x1 = Balance
 
|-
 
|-
| 0x20 || Byte[12] || {{Unknown|'''Unknown.''' Padding?}}
+
| 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 || {{Unknown|Reserved.}}
 
|}
 
|}
  
 
==== Sound Data Subsection 2 ====
 
==== Sound Data Subsection 2 ====
 
 
===== RSEQ =====
 
===== RSEQ =====
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 202: Line 203:
 
| 0x04 || UInt32 || Soundbank index
 
| 0x04 || UInt32 || Soundbank index
 
|-
 
|-
| 0x08 || Byte[3] || {{Unknown|'''Unknown.'''}}
+
| 0x08 || UInt32 || RSEQAllocTrack
 
|-
 
|-
| 0x0C || Byte || RSEQAllocTrack
+
| 0x0C || Byte || SeqChannelPriority
 
|-
 
|-
| 0x10 || Byte || SeqChannelPriority
+
| 0x0D || Byte || Release priority fix flag
 
|-
 
|-
| 0x14 || Byte[7] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0E || Byte[2] || {{Unknown-left|Padding}}
 
|-
 
|-
 +
| 0x10 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
 
===== RWSD =====
 
===== RWSD =====
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 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
|-
+
|-  
| 0x09 || Byte[7] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0A || Byte[2] || {{Unknown-left|Padding}}
 
|-
 
|-
 +
| 0x0C || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
 
===== RSTM =====
 
===== RSTM =====
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 0x00 || UInt32 || Start Position
 
| 0x00 || UInt32 || Start Position
 
|-
 
|-
| 0x04 || Byte || {{Unknown|'''Unknown.'''}}
+
| 0x04 || UInt16 || AllocChannelCount
|-
 
| 0x05 || Byte || AllocChannelCount
 
|-
 
| 0x06 || Byte || RSTMAllocTrack
 
 
|-
 
|-
| 0x07 || Byte[7] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x06 || UInt16 || AllocTrackFlag
 
|-
 
|-
 +
| 0x08 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
==== Sound Data Subsection 3 ====
+
==== Sound 3D Parameters ====
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 0x00 || UInt32 || Sound3DParam flags
 
| 0x00 || UInt32 || Sound3DParam flags
 
|-
 
|-
| 0x04 || Byte || DecayCurve
+
| 0x04 || Byte || Decay Curve (1 = Logarithmic, 2 = Linear)
 +
|-
 +
| 0x05 || Byte || Decay Ratio
 
|-
 
|-
| 0x05 || Byte || DecayRatio
+
| 0x06 || Byte || Doppler Factor
 
|-
 
|-
| 0x06 || Byte[6] || {{Unknown|'''Unknown.'''}}
+
| 0x07 || Byte || {{Unknown-left|Padding}}
 
|-
 
|-
 +
| 0x08 || UInt32 || {{Unknown-left|Reserved}}
 
|}
 
|}
  
 
=== Soundbank Table ===
 
=== Soundbank Table ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
 
|-
 
|-
| 0x08 || UInt32 || Offset to the second entry.
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Soundbank Entry|Soundbank Entries]].
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
 
=== Soundbank Entry ===
 
=== Soundbank Entry ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 0x00 || UInt32 || File name index
 
| 0x00 || UInt32 || File name index
 
|-
 
|-
| 0x04 || Uint32 || File index
+
| 0x04 || UInt32 || File collection index
 
|-
 
|-
 
| 0x08 || UInt32 || Bank index
 
| 0x08 || UInt32 || Bank index
|-
 
 
|}
 
|}
  
 
=== Player Info Table ===
 
=== Player Info Table ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
 
|-
 
|-
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Player Info Entry|Player Info Entries]].
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|}
 
|}
  
 
=== Player Info Entry ===
 
=== Player Info Entry ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Player Info Index
+
| 0x00 || UInt32 || File name index
 
|-
 
|-
 
| 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"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || '''N''' = Number of entries.
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the first entry.
 
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
 
|-
 
|-
| colspan=3 align=center | '''...'''
+
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Collection Entry|Collection Entries]].
 
|}
 
|}
  
 
=== Collection Entry ===
 
=== Collection Entry ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 361: Line 334:
 
| 0x04 || UInt32 || Length of the audio data. Null for RSEQ or external files.
 
| 0x04 || UInt32 || Length of the audio data. Null for RSEQ or external files.
 
|-
 
|-
| 0x08 || UInt32 || {{Unknown|'''Unknown.''' Always 0xFFFFFFF}}
+
| 0x08 || Int32 || Entry number (always -1)
 
|-
 
|-
| 0x0C || Byte[8] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0C || [[#Data Reference|DataRef]] || Reference to external file name.
 
|-
 
|-
| 0x14 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x14|| [[#Data Reference|DataRef]] || Reference to [[#Collection Position Table|Collection Position Table]].
 +
|}
 +
 
 +
==== Collection Position Table ====
 +
{| class="wikitable"
 
|-
 
|-
| 0x18 || Uint32 || Offset to the second subsection, or to the external file name for external files. Usually follows this value anyway.
+
! Offset !! Type !! Description
 
|-
 
|-
| 0x1C || Uint32 || Group index
+
| 0x00 || UInt32 || '''N''' = Number of entries.
|-
 
| 0x20 || Uint32 || Index within group
 
 
|-
 
|-
 +
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Collection Position Entry|Collection Position Entries]].
 
|}
 
|}
  
=== Group Table ===
+
==== Collection Position Entry ====
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries.
+
| 0x00 || UInt32 || Group index
 
|-
 
|-
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x04 || UInt32 || Index within group
 +
|}
 +
 
 +
=== Group Table ===
 +
{| class="wikitable"
 
|-
 
|-
| 0x08 || UInt32 || Offset to the first entry.
+
! Offset !! Type !! Description
|-
 
| 0x04 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x08 || UInt32 || Offset to the second entry.
 
 
|-
 
|-
| colspan=3 align=center | '''...'''
+
| 0x00 || UInt32 || '''N''' = Number of entries.
 
|-
 
|-
 +
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to [[#Group Data Entry|Group Data Entries]].
 
|}
 
|}
  
 
=== Group Data Entry ===
 
=== Group Data Entry ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || Number of entries in the group.
+
| 0x00 || UInt32 || File name index.
 
|-
 
|-
| 0x04 || UInt32 || {{Unknown|'''Unknown.''' Always 0xFFFFFFF}}
+
| 0x04 || UInt32 || Entry Number.
 
|-
 
|-
| 0x0C || Byte[8] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x08 || [[#Data Reference|DataRef]] || Reference to external filepath string.
 
|-
 
|-
| 0x14 || Uint32 || Offset to the RSEQ, RBNK, or RWSD file.
+
| 0x10 || UInt32 || Offset to the RSEQ, RBNK, or RWSD file.
 
|-
 
|-
| 0x18 || Uint32 || Size of the RSEQ, RBNK, or RWSD file.
+
| 0x14 || UInt32 || Size of the RSEQ, RBNK, or RWSD file.
 
|-
 
|-
| 0x1C || Uint32 || Offset to the RWAR or DSP file.
+
| 0x18 || UInt32 || Offset to the RWAR or DSP file.
 
|-
 
|-
| 0x20 || Uint32 || Size of the RWAR or DSP file.
+
| 0x1C || UInt32 || Size of the RWAR or DSP file.
 
|-
 
|-
| 0x24 || 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"
 
|-
 
|-
| 0x28 || Uint32 || Offset to the second subsection. Usually follows this value anyway.
+
! Offset !! Type !! Description
|-
 
| 0x2C || UInt32 || Number of entries in the subsection. All data after this is absent if this is 0x00.
 
|-
 
| 0x30 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
 
|-
 
| 0x34 || UInt32 || Offset to the first entry
 
 
|-
 
|-
| 0x38 || Uint32 || {{Unknown|'''Unknown.''' Always 0x01000000.}}
+
| 0x00 || UInt32 || '''N''' = Number of entries.
|-
 
| 0x3C || UInt32 || Offset to the second entry.
 
|-
 
| colspan=3 align=center | '''...'''
 
 
|-
 
|-
 +
| 0x04 || [[#Data Reference|DataRef]]['''N'''] || References to the [[#Group Item Info Entry|Group Item Info Entries]].
 
|}
 
|}
  
==== Subsection 2 Entry ====
+
==== Group Item Info Entry ====
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
 
| 0x00 || UInt32 || Group index
 
| 0x00 || UInt32 || Group index
|-  
+
|-
 
| 0x04 || UInt32 || Offset to the file, relative to the value at 0x14 of the main entry.
 
| 0x04 || UInt32 || Offset to the file, relative to the value at 0x14 of the main entry.
 
|-
 
|-
Line 446: Line 415:
 
|-
 
|-
 
| 0x0C || UInt32 || Offset to the audio data, relative to the value at 0x1C of the main entry.
 
| 0x0C || UInt32 || Offset to the audio data, relative to the value at 0x1C of the main entry.
|-  
+
|-
 
| 0x10 || UInt32 || Size of the audio data.
 
| 0x10 || UInt32 || Size of the audio data.
 
|-
 
|-
| 0x14 || UInt32 || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x14 || UInt32 || {{Unknown-left|Reserved.}}
|-
 
 
|}
 
|}
  
 
=== Sound Count Table ===
 
=== Sound Count Table ===
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 465: Line 432:
 
| 0x04 || UInt16 || StrmSoundCount
 
| 0x04 || UInt16 || StrmSoundCount
 
|-
 
|-
| 0x04 || UInt16 || StrmTrackCount
+
| 0x06 || UInt16 || StrmTrackCount
 +
|-
 +
| 0x08 || UInt16 || StrmChannelCount
 
|-
 
|-
| 0x06 || UInt16 || WaveSoundCount
+
| 0x0A || UInt16 || WaveSoundCount
 
|-
 
|-
| 0x08 || UInt16 || WaveTrackCount
+
| 0x0C || UInt16 || WaveTrackCount
 
|-
 
|-
| 0x0A || Byte[20] || {{Unknown|'''Unknown.''' Padding?}}
+
| 0x0E || UInt16 || {{Unknown-left|Padding.}}
 
|-
 
|-
 +
| 0x10 || UInt32 || {{Unknown-left|Reserved.}}
 
|}
 
|}
  
== FILE ==
+
=== FILE ===
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-  
+
|-
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
Line 488: Line 457:
 
|-
 
|-
 
| 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.
 
|}
 
|}
  
 
== Tools ==
 
== Tools ==
 
 
The following tools can handle BRSAR files:
 
The following tools can handle BRSAR files:
* [[BrawlBox]], by [[Kryal]] & [[BlackJax]]
+
* [[BrawlBox]], by Kryal and BlackJax96
 +
* [[BrawlCrate]], by soopercool101
 
* [[BRSAR Extractor]], by [[Atlas]]
 
* [[BRSAR Extractor]], by [[Atlas]]
  
 +
== Links ==
 +
{{BRRES links}}
 
[[Category:File Format/Wii]]
 
[[Category:File Format/Wii]]

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