BARS (File Format)

From Wexos's Wiki
Jump to navigationJump to search

BARS (Binary Audio ReSource) is a file format used in Nintendo Switch games such as Mario Kart 8 Deluxe, The Legend of Zelda: Breath of the Wild and Super Mario Maker 2. It contains audio data such as sound effects, as well as BFSTP files and other references used along with BFSTM files. BARSLIST files index which BARS files are used by the game.

File Format

Header

The file starts with a header that is 0x10 bytes long.

Offset Type Description
0x00 Char[4] File magic. Always BARS in ASCII.
0x04 UInt32 File size in bytes.
0x08 UInt16 Byte-order-mark. FE FF for big endian, FF FE for little endian.
0x0A UInt16 Version number.
0x0C Int32 Number of audio entries (N).
0x10 End of header, start of Hash List

Hash List

This section contains N CRC-32 hashes of the audio file names.

Entry List

Followed by the hash list, there is an audio entry list with N entries. The audio entries are sorted by the name hash.

Format of an audio entry
Offset Type Description
0x00 UInt32 Offset to BAMTA file data.
0x04 UInt32 Offset to BFWAV file data, BWAV file data or BFSTP file data. v1.2 also supports MINF.

Note that BAMTA and MINF data is always aligned by 4, and BFWAV, BWAV and BFSTP data by 0x40.

Version List

Version Found in
1.1
1.2

Tools

The following tools can handle BARS files:

  • (none)