BARS (File Format)

From MK8
Jump to navigation Jump to search
Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.
Platform Notice
This article is about Mario Kart 8 for Wii U. The relation to Mario Kart 8 Deluxe is not entirely clear.

BARS Files are a specific type of SARC archive containing audio data (SFX). In Mario Kart 8 Deluxe, BARS files (like BGM.bars for prefetch files of course audio) follow a different format. BARS archives are used in various other Wii U or 3DS games as well, such as Breath of the Wild. However, this article focuses on their appearance in Mario Kart 8, where they contain specific sets of files. BARS files exist for various game elements, each of which is detailed below.

Usage

Courses

Each course has its own BARS archive, located in its course folder.

Music Prefetch Files

Each course's BARS file always contains two BFSTP files: one for the course's music and one for the course's final lap music. Note, however, that this prefetch audio data goes unused in Mario Kart 8 for Wii U. The file names of these prefetch files are identical to those of the course's music among the streamed audio files. For example, 3DS DK Jungle's BARS archive contains pBGM_3DS_DK_JUNGLE_N.bfstp and pBGM_3DS_DK_JUNGLE_F.bfstp.

Both these BFSTP files are in a big endian format. This is in contrast to Mario Kart 8 Deluxe, where they are little endian. The version indicator is also different between these types of files in the two games.

Deleting these prefetch files does not prevent the course's music from playing.

Environmental SFX

Environmental (BFWAV) sound effects that only play in certain areas are also located in a course's BARS archive. Examples are the cheering crowd in Mario Kart Stadium or the airport announcer in Sunshine Airport.

Course Intro SFX

(BFWAV) Sound effects that occur during the course intro also appear in each course's BARS archive. File names for these SFX are often prepended with "Demo". Examples of these include cow bells in the course intro for Wii Moo Moo Meadows, or airship noises in Cloudtop Cruise's course intro.

Deleting these sound files from the archive mutes them during the course intro.

Lap Change SFX

The custom start jingle and final lap announcer of the F-Zero tracks are also located in the course's BARS archives.

Map Objects

All MapObj sounds.

Characters

All character SFX.

_param.bin

Regardless of the purpose of the BARS archive, each contains a file named _param.bin. Although its exact purpose is currently unknown, it references all other files located in the archive. Although its header contains the "BARS" magic, its format is distinctly different from Mario Kart 8 Deluxe BARS archives, which follow an entirely different file format.

Header

Each _param.bin file starts with a 0x20 length header.

_param.bin Header
Offset Size Description
0x00 4 BARS in ASCII.
0x04 2 Endianness. Always BE (0xfe, 0xff).
0x06 2 Unknown. Always 00 20.
0x08 4 File Size in bytes.
0x0c 4 Sound Block Size. Size (in bytes) of each Sound Block (see below). Always 0x54.
0x10 4 Size of Header. Always 0x20.
0x14 4 Sound Block Section Size. Size (in bytes) of the sound block section (see below).
0x18 4 Name Section Offset (see below). Always Sound Block Section Size + 0x20.
0x1c 4 Name Section Size. Size (in bytes) of the name section (see below).
0x20 End of the header

Sound Blocks

Directly after the header a number of sound blocks follow. The number of sound blocks is equal to Sound Block Section Size / Sound Block Size from the header. The offsets below are relative to the start of each sound block. Each sound block contains data for one of the files in the BARS archive.

Several pieces of data are "named offsets". That is, they are an offset (relative to the start of the name section) referencing a name in the name section (see below). Note that a named offset can refer to an empty string.

Sound Block
Offset Size Description
0x00 4 Identifier (named offset). Some sort of audio identifier. Always starts with pSE (sound effect), pBGM (prefetch audio. background music), pVO (character voice-over). Prefix matches the data in the sound-type named offset.
0x04 4 Filename (named offset). Identical to the name of one of the files in the BARS archive _param.bin is located in.
0x08 4 BFSTM filename. If the file is a BFSTP file, references the name of the BFSTM file it contains prefetch data for. Empty otherwise. E.g., for a file FZeroBigblue_Reslut_WU.aa.32.dspadpcm.bfstp, this is FZeroBigblue_Reslut_WU.aa.32.dspadpcm.bfstm.
0x0c 4 Sound Stream (named offset). References some sort of sound stream. Examples include STRM_DUMMY_TR1, STRM_DUMMY_TR2, or WSD_DUMMY.
0x10 4 Unknown (named offset). Usually empty.
0x14 4 Unknown (named offset). Usually empty.
0x18 4 Unknown (named offset). Usually empty.
0x1c 4 Unknown (named offset). Usually empty.
0x20 4 Sound Type (named offset). Type of the sound. Examples include PLAYER_SE_ENV, PLAYER_BGM, PLAYER_VOICE.
0x24 4 A Counter of some sort. The starting value seems arbitrary, but most of the time this value is equal to this value of the previous sound block + 1.
0x2c 44 Unknown.
0x54 End of sound block

Names

At the end of _param.bin is a list of null-terminated ASCII strings, each of which is referenced by one or more sound blocks. The order in which these names occur seems arbitrary.

Tools

For tools that can handle the BARS archive format, see here

The following tools can handle _param.bin:

  • (None)