NW > Sound > Sound Archive (FSAR)

A BFSAR file is an archive with all kinds of sound-related files.

Block idDescription
0x2000String block
0x2001Info block
0x2002File block

String Block

OffsetSizeDescription
0x04Identifier ("STRG")
0x44Block size
0x88String table reference (0x2400)
0x108Search tree reference (0x2401)

String Table

OffsetSizeDescription
0x04Number of strings
0x4String table entries

String Table Entry

OffsetSizeDescription
0x08String reference (0x1F01)
0x84String size, including null terminator

String Search Tree

This is a binary search tree to efficiently find strings in the table.

OffsetSizeDescription
0x04Root node index
0x44Number of nodes
0x8Tree nodes

Search Tree Node

OffsetSizeDescription
0x021 if this is a leaf, 0 otherwise
0x22String bit index
0x44Left child index, go here when the bit is 0
0x84Right child index, go here when the bit is 1
0xC4String table index
0x104Item id

Info Block

OffsetSizeDescription
0x04Identifier ("INFO")
0x44Block size
0x88Reference to sound info reference table (0x2100)
0x108Reference to sound group info reference table (0x2104)
0x188Reference to bank info reference table (0x2101)
0x208Reference to wave archive info reference table (0x2103)
0x288Reference to group info reference table (0x2105)
0x308Reference to player info reference table (0x2102)
0x388Reference to file info reference table (0x2106)
0x408Reference to sound archive player info (0x220B)

Info Reference Table

OffsetSizeDescription
0x04Number of entries
0x4References
Info typeReference id
Sound info0x2200
Sound group info0x2204
Bank info0x2206
Wave archive info0x2207
Group info0x2208
Player info0x2209
File info0x220A

Sound Info

This structure describes a sound file (STRM/WSD/SE).

OffsetSizeDescription
0x04File index
0x44Player item id
0x81Initial volume
0x91Remote filter
0xA2Padding
0xC8Reference to stream (0x2201), wave (0x2202) or sequence (0x2203) info
0x144Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present). The user param fields can be used to store additional information that can be read by the game.

FlagDescription
0x1String table index (name)
0x20x0000XXYY: XX = pan curve, YY = pan mode
0x40x0000XXYY: XX = actor player id, YY = player priority
0x100Offset to 3D info
0x20000Is front bypass
0x10000000User param 1
0x20000000User param 2
0x40000000User param 3
0x80000000User param 4

Sound 3D Info

OffsetSizeDescription
0x04Flags
0x44Unknown float
0x81Unknown
0x91Unknown

Stream Sound Info

OffsetSizeDescription
0x02Bitmask defining which tracks are valid
0x22Number of channels (up to 16)
0x48Reference to track info table (0x0101)

Track Info Table

OffsetSizeDescription
0x04Number of entries
0x4Track info references (0x220E)

Track Info

OffsetSizeDescription
0x01Unknown
0x11Unknown
0x21Unknown
0x31Unknown
0x48Reference to track channel info (0x0100)

Track Channel Info

OffsetSizeDescription
0x04Number of entries (up to 2)
0x4Channel indexes (one byte per entry)

Wave Sound Info

OffsetSizeDescription
0x04Wave index in wave archive
0x44Unknown
0x84Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x10x0000XXYY: XX = Release priority fix, YY = Channel priority

Sequence Sound Info

OffsetSizeDescription
0x08Reference to bank id table (0x0100)
0x84Bitmask defining which tracks are valid
0xC4Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1Start offset
0x20x0000XXYY: XX = Release priority fix, YY = Channel priority

Bank ID Table

OffsetSizeDescription
0x04Number of entries
0x4Bank item ids

Sound Group Info

This structure describes a set of sound files.

OffsetSizeDescription
0x04Item id of first sound
0x44Item id of last sound
0x88Reference to file table (0x0100)
0x108Reference to wave archive table reference (0x2205)
0x184Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1String table index (name)

File Table

OffsetSizeDescription
0x04Number of entries
0x4File indices

Wave Archive Table Reference

OffsetSizeDescription
0x08Reference to wave archive table (0x0100)

Bank Info

This structure describes a bank file.

OffsetSizeDescription
0x04File index
0x48Reference to wave archive table (0x0100)
0xC4Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1String table index (name)

Wave Archive Table

OffsetSizeDescription
0x04Number of entries
0x4Wave archive item ids

Wave Archive Info

This structure describes a wave archive file.

OffsetSizeDescription
0x04File index
0x41Unknown
0x53Padding
0x84Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1String table index (name)
0x2Number of wave files

Group Info

This structure describes a group file.

OffsetSizeDescription
0x04File index
0x44Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1String table index (name)

Player Info

This structure describes a sound player.

OffsetSizeDescription
0x04Playable sound limit
0x44Flags. This field specifies which of the following fields is present.

Every optional field takes up exactly 4 bytes (if present).

FlagDescription
0x1String table index (name)
0x2Player heap size

File Info

This structure describes a single file. A file can be stored either internally or in an external file.

OffsetSizeDescription
0x08Reference to internal file info (0x220C), or external file info (0x220D)

Internal File Info

If this file is stored in a group file instead of the file block, offset and filesize are set to -1.

OffsetSizeDescription
0x08Reference into file block body (0x1F00)
0x84Filesize

External File Info

OffsetSizeDescription
0x0Null-terminated filename string

Sound Archive Player Info

This structure defines limits that are used to determine how much memory should be allocated.

OffsetSizeDescription
0x02Number of sequence sounds
0x22Number of sequence tracks
0x42Number of stream sounds
0x62Unknown
0x82Number of stream channels
0xA2Number of wave sounds
0xC2Unknown

File Block

This block contains the actual subfiles of the BFSAR file. All files are aligned to 32 bytes.

OffsetSizeDescription
0x04Identifier ("FILE")
0x44Block size
0x8Files