Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Decodes PS2 VAG and SPU2 ADPCM sound banks to WAV, and encodes your WAV back to VAG at original size and rate.
27% 95%+68 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 6 of 22 without it.
3 of 3 safety checks passed
Not used yet
The Sound Designer gets a game's audio out as WAV files you can listen to, and puts your own sounds
back in the same format. PS2 audio is Sony's SPU2 ADPCM: 16-byte frames of 28 samples each. It lives in
.vag files (a 48-byte VAGp header, then the frames), in sound banks (a .hd header plus a .bd of
headerless frames) and in game-specific streams. vag.py decodes exactly the way the PS2Recomp runtime
does (ps2xRuntime/src/lib/ps2_audio_vag.cpp), so what you hear is what the port plays.
Honest limits. The port's audio is high level: ps2xRuntime/src/lib/ps2_audio.cpp decodes the VAGp
blocks a game transfers and plays them through raylib when the game sends libsd voice commands. It is
not a full SPU2, so loop flags, reverb, envelopes and music streamed through a game's own driver may not
play in the port yet (that is /console-backend work). Banks have no rate in the .bd; it comes from the
.hd or from your ears. Movies (PSS) are out of scope.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/vag.py" info console/disc/SOUND/BGM01.VAG # rate, length, loop points, header
python3 "${CLAUDE_SKILL_DIR}/vag.py" towav console/disc/SOUND/BGM01.VAG # -> console/audio/BGM01.wav
python3 "${CLAUDE_SKILL_DIR}/vag.py" scan console/disc/DATA/SOUND.PAK --extract console/audio/pak
python3 "${CLAUDE_SKILL_DIR}/vag.py" split console/disc/SOUND/SE.BD --rate 22050 --out console/audio/se
python3 "${CLAUDE_SKILL_DIR}/vag.py" towav console/disc/SOUND/STREAM.BIN --rate 48000 --channels 2 --interleave 0x800
python3 "${CLAUDE_SKILL_DIR}/vag.py" fromwav my_song.wav --like console/disc/SOUND/BGM01.VAG --out console/audio/BGM01.VAG
Other flags: --offset N (a VAG or raw data inside a bigger file), --all (decode past end flags),
--json. For fromwav: --loop, --loop-start N, --no-loop, --rate N, --mono,
--stereo split|interleave --interleave N, --allow-bigger, --exhaustive, --no-lead-frame,
--name. Exit codes: 0 ok, 1 needs attention (odd frames, a replacement too big), 2 bad input.
| file | what |
|---|---|
*.vag | VAGp header + ADPCM frames: read by info/towav, written by fromwav |
*.bd (+ *.hd) | a sound bank. split cuts the .bd at end flags (a heuristic); the .hd (starts IECSsreV) holds the real list |
| any big file | scan finds VAGp headers inside it; --extract writes each one out |
*.wav | 16-bit PCM, mono or stereo, in and out. Loop points travel in a smpl chunk both ways |
console/audio/ | the default output folder |
console/audio/<bank>/split.json | offset, size and loop of every sound split found |
Next to this one in the catalogue, plus more from the same author.