Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:VAG

From ReverseEngineering.wiki
Format
Platforms Platform:PlayStation
Magic 56 41 47 70 ("VAGp") at 0x0
Extensions .vag, .vig, .vas, .swag
Endianness big (header), little (a few variants)
On this wiki Facts · Code · Notes · Topics

Sony's single-sample audio file (.vag): a 0x30-byte big-endian header (ID "VAGp", version, data size, sample rate, 16-character name) followed by SPU-ADPCM blocks; used on PlayStation 1 to 3 with several stereo and endianness variants.

Overview

A VAG is one mono sample: a header and raw Format:SPU-ADPCM (PlayStation) data. Stereo files exist but have no single standard; they are interleaved in console- and tool-specific ways. Samples inside Format:VAB banks are the same data without the header.

Header

Header fields are big endian in the common variant.

Offset Size Meaning
0x00 4 ID, usually "VAGp"
0x04 4 version (2 or 0x20 are common on PlayStation 1)
0x08 4 reserved, 0 (interleave for "VAGi")
0x0C 4 data size per channel
0x10 4 sample rate in Hz (0x5622 = 22050)
0x14 12 reserved (version 2: default SPU voice registers)
0x20 16 name, ASCII zero padded
0x30 ADPCM data (the first 16-byte block usually zero)

Variants

Other IDs: "VAG1" (one channel) and "VAG2" (two channels), "VAGi" (two channels, interleave little endian at 0x08), "pGAV" (little endian with extended header, PS2 Jak titles), "AAAp" (extra header before a "VAGp" header). Versions 0x00020001 and 0x00030000 mark HEVAG coding (PS4/Vita), not SPU-ADPCM. Stereo interleave sizes seen include 0x10, 0x800 and half the file size, depending on the game or extension (.vig, .vas, .swag).

Evidence & references

  • psx-spx, "CDROM File Audio Single Samples VAG (Sony)" (docs/cdromfileformats.md in the psx-spx mirror).