Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[REQUEST] Script/program for extracting PS2 VAG files.

Featured Replies

  • Author
  • Localization

AnonBaiter, posted Sat Apr 16, 2016 4:52 pm (12634)


I tested your tool and although it needs some work, it was quite useful in the end. At least, with the latter archive file I provided.

This .vag file, for example, has three audio files tied together(see the attachment below).

That's just what I wanted to report though. Good luck on your tool, I guess.
  • Author
  • Localization

id-daemon, posted Sat Apr 16, 2016 5:32 pm (12636)


Yes, there are no "end" flag in these streams. They have a "start" flag instead. Do you have correct meanings for VAG flags? Becuase I'm just guessing them.

I think this tool must have a lot of settings. In this case, for example, a block of zeroes will be used as an end of stream.
  • Author
  • Localization

AnonBaiter, posted Sat Apr 16, 2016 8:56 pm (12643)


id-daemon wrote:
I think this tool must have a lot of settings. In this case, for example, a block of zeroes will be used as an end of stream.

Then they are dumped as raw VAG files, correct?
And speaking of settings, how can I use them? Your tools always consisted of "drag-and-drop the original file" kind of approach.
  • Author
  • Localization

id-daemon, posted Sun Apr 17, 2016 7:57 am (12650)


AnonBaiter wrote:
Then they are dumped as raw VAG files, correct?

I can also decode them to WAV.

AnonBaiter wrote:
Then they are dumped as raw VAG files, correct?
And speaking of settings, how can I use them? Your tools always consisted of "drag-and-drop the original file" kind of approach.

No, not always.

It can be GUI tool like Evolution engine tool viewtopic.php?f=6&t=1960
Or command line parameters, like usual. When you "drop the file" it means you have only have 1 parameter (file name), but there may be more.
  • Author
  • Localization

id-daemon, posted Mon Apr 18, 2016 11:46 am (12672)


What game is that 8225 file from?
  • Author
  • Localization

AnonBaiter, posted Mon Apr 18, 2016 2:48 pm (12677)


id-daemon wrote:
What game is that 8225 file from?

World Soccer Winning Eleven 5.
  • Author
  • Localization

id-daemon, posted Mon Apr 18, 2016 5:21 pm (12683)


Ok, after many tests I can confirm that universal approach for this tool can only be based on manual switching of different methods for detecting stream start, end, and interleave. There are many types, and there's no way to detect this automatically.

So for example, you will need to run scan in "mono" mode first, then stereo.

I will try and support most usual cases, and then maybe if there will be interest in this, I can expand it.

If you have more examples that you think will be interesting, send them.
  • Author
  • Localization

AnonBaiter, posted Mon Apr 18, 2016 7:47 pm (12685)


id-daemon wrote:
If you have more examples that you think will be interesting, send them.

I'll try my best!
  • Author
  • Localization

id-daemon, posted Tue Apr 19, 2016 2:22 pm (12698)


Things are going good. 2 common interleave types already implemented. Used in "the warriors" and your World Soccer Winning Eleven.

Must say that Luigi's vaguess tool didn't work right with "the warriors", and couldn't detect interleave in all cases. As a result, his tool extracts 299 files, while there are actually 349. My current tool works better and currently detects 343 files there. While the remaining 6 have size exactly divisible by its interleave, making it impossible to detect by "zero blocks".

It's possible to decode even those, but only manually.
  • Author
  • Localization

id-daemon, posted Tue Apr 19, 2016 2:54 pm (12699)


For example, if we have stream with length = 0x221100, then out of all possible Warriors interleaves (from 6E00 to 8000 with step 40) we have only one exact divider, and it is 72C0. So this will be an interleave for this stream. I checked that and its working.

Image
  • Author
  • Localization

id-daemon, posted Tue Apr 19, 2016 2:58 pm (12700)


Howether, for another stream of 0x2B1100 bytes, there are three dividers: 6E40, 7080 & 7A80, so I had to check them all to find the right one. It was 6E40.
  • Author
  • Localization

id-daemon, posted Tue Apr 19, 2016 4:39 pm (12703)


At last, after lots of testing, I'm ready to present the first tool version that supports stereo interleaved streams. For now, it will only scan file and output raw files, that you can check. After more testing, I think I can add decoding too.

Usage:
vag_scanner [file_name] [mode]

modes:
s1 - stereo with last short block (like in soccer)
s2 - stereo with all blocks of equal size (like in warriors)
s3 - stereo with "end of stream" markers
anything else - mono mode

If you don't set [mode] parameter, it will presume mono. So if you just drag a file onto the tool, it will work mono,

Usually all streams in one game will be the same type. So you only need to find the right mode, and it will extract all stereo streams. Some games may work with two modes (for example s1 & s3). Additional run may be needed for mono files, while most stereo modes will also output mono files correctly.

vag_scanner.rar

  • Author
  • Localization

id-daemon, posted Tue Apr 19, 2016 9:42 pm (12710)


I think no need to decode them. Just make SVAG headers, and they will be playable.
  • Author
  • Localization

id-daemon, posted Wed Apr 20, 2016 6:13 am (12715)


So let me know, if I can leave it like this, make the tool add headers, or it would be better to decode to WAV.
  • Author
  • Localization

AnonBaiter, posted Wed Apr 20, 2016 2:22 pm (12718)


id-daemon wrote:
So let me know, if I can leave it like this, make the tool add headers, or it would be better to decode to WAV.

I think it would be best to leave the tool as is. The rest is up to you.
  • Author
  • Localization

id-daemon, posted Wed Apr 20, 2016 5:50 pm (12727)


Ok. I already made some adjustments for better handling mode s3, I will update the tool soon. If you'll encounter any files that it can't handle, let me know, maybe I can add more modes.
  • Author
  • Localization

id-daemon, posted Tue May 03, 2016 10:16 am (13070)


So was the tool any useful?

In my experience, the best it can do, is detecting any streams (using mono mode) and only give hints to possible interleave values.
  • Author
  • Localization

AnonBaiter, posted Tue May 03, 2016 2:08 pm (13075)


It was useful. Thanks for that.
  • Author
  • Localization

AnonBaiter, posted Fri May 27, 2016 6:47 pm (13720)


Hey id-daemon, sorry it took so long but here is another sample.
  • Author
  • Localization

AnonBaiter, posted Wed Jun 22, 2016 11:57 pm (14683)


Is it just me or do the detected MUSIC.SND files have some wrong interleaves/offsets in them?
  • Author
  • Localization

id-daemon, posted Fri Jun 24, 2016 3:11 pm (14733)


I'm very busy with textures, models and skeletons research for the latest time. Maybe I will check this later, when I'll be in the mood to return to sounds.
  • Author
  • Localization

Spy Ring, posted Tue Jun 05, 2018 11:36 am (35607)


For VAG's i use "Multistream F-Packer" is a official tool from PS2 SDK
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.