GTA San Andreas (PS2) - Need help with .VAG audio header
Page 1 of 1

Author:  BloodRaynare [ Tue Nov 14, 2017 4:45 am ]
Post subject:  GTA San Andreas (PS2) - Need help with .VAG audio header

Guys, I'm trying to mod the audio files of PS2 version of GTA SA (more specifically, I want to mod the radio commercials).

There's a set of tools which does extracting and repacking the audio archives as well encoding and decoding the audio files (You can find it by searching "Pack Extract-Rebuild Radio GTA S-A" on google). But, the encoder only works for radio station songs (not to mention the program sometimes crash when converting files). Basically, the encoder splits your audio into 3 parts (intro, middle, and the outro of the songs) and I wanted the files to be converted into single audio.

Because of that, I figured how about I convert the audio myself with the help from MFAudio + Hex Editor?
So, I start to examine the content of the files. For example, I extracted the ADVERTS.PAK with one of the tools (Stream_PAK.exe) and examine one of the extracted files (FILE0000.VAG) with the hex editor (I use HxD).

At the start of the files there's 4 bytes of "0xFF" dunno what is this, probably some kind of IDString, but what I needed for help is actually on the offset 0x1F40.

As you can see on the image above, there's information about the files (They appeared twice). However, the only thing I could figure out is the frequencies of the audio (at offset 0x1F54 and 0x1F5C, there's hex value of C0 5D 00 00 which when converted to decimal is 24000, so the audio freq is 24000 Hz). I don't know what the rest of the value are (Probably sample lengths or something?).

After that at offset 0x1F64 (or 0x1F74?) is where the audio data starts. The audio data was stored with PS2 Compressed ADPCM format. And, some interesting bits about the audio data. At the start of audio data (or 0x10) and on the next 0x20000 (Like 0x21000, 0x42000 and so on...) offset there's 0x1000 of garbage audio data (sounds like rewind?).

Make the audio data is easier since I just need the convert the audio, split the converted audio to 128kb (131072 bytes), take the garbage audio data, paste to each splitted files, and combine the files again.

Here's the sample files if you guys needed to study the files (It's on the attachment)
Who knows maybe you guys can make it into BMS script or even the standalone tools.

FILE0000.rar [1.41 MiB]
Downloaded 43 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited