psx.wiki

VAB (PS Sound Source Data)

Group of VAG waveforms and their playback attributes.

VAB (PS Sound Source Data)
Header file.VH
Body file.VB
IDVABp

Overview

The VAB format manages several VAG files as a single group, and it is handled as a single file at runtime. A VAB file contains the sounds, sound effects and other sound data that are used in a scene.1

The data is managed in a hierarchy of programs and tone lists, which supports multitimbral (multisampling) functions. Several tone lists can reference the same waveform. Each tone list has its own playback parameters, and the same waveform can therefore give different sounds. The limits of the hierarchy are as follows:1

Table 1: VAB limits
Item Maximum
Programs per VAB 128
Tone lists per program 16
VAG files per VAB 254

Organization

A VAB is divided into a header (.VH) and a body (.VB). The header holds the bank attributes and the program, tone and VAG offset tables. The body holds the VAG waveforms from VAG (0) to the VAG count, and each VAG can be up to 516,096 bytes.2

Table 2: VAB header (.VH)
Field Byte count
ID (VABp) 4
Version 4
VAB ID 4
Waveform size 4
System reserved 2
Number of programs 2
Number of tones 2
VAG count 2
Master volume 1
Master pan 1
Bank attribute 1 (user defined) 1
Bank attribute 2 (user defined) 1
System reserved 4
Program attribute table 16 x 128 (maximum programs)
Tone attribute table 32 x 16 (maximum tones) x number of programs
VAG offset table 512

Structure

Each attribute in the VAB header can be set dynamically at execution time through a structure. The structures are described in the libsnd section of the Run-Time Library Reference, and the header holds them as follows:2

Table 3: VAB header structures
Area Structure
First 32 bytes VabHdr
Program attribute table ProgAtr, one for each of 128 programs
Tone attribute table VagAtr, one for each tone

VAG Offset Table

The VAG offset table holds the size of each VAG as a 16-bit short that is shifted right by 3 bits. The actual size of a VAG is therefore 8 times its table value. In the manual's example below, the Offset row is the running total of the actual sizes:23

Table 4: VAG offset table
VAG# 0 1 2
VAG offset table 0x1000 0x0800 0x0200
Actual size 0x8000 0x4000 0x1000
Offset 0x8000 0xc000 0xd000

References


  1. ^ a b Sony Computer Entertainment Inc. File Formats. November 1998. Page 4-5.

  2. ^ a b c Sony Computer Entertainment Inc. File Formats. November 1998. Page 4-6, Figure 202.

  3. ^ Sony Computer Entertainment Inc. File Formats. November 1998. Page 4-7, Table 4-1.

Categories: File formats