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 Mon Apr 04, 2016 3:38 pm (12411)


Short version: Exactly what it says in the title.
Long version: All I need is a quickBMS script or a program that can dump or extract PS2 audio files, be it in VAG, SS2, MIB, MIH MIB, MST or VSF format from a file that contains them. Maybe detect the sample rate and interleave for each file - kind of like PSound, except it has to be extracted at a raw format.

I'll provide the samples later, but in the meantime you can take a look at these files(rebuild the file using filecutter_rebuilder.bms script):
https://mega.nz/#!xAtQACQJ!ZoEDOgs4RDx7dVbkfrrNP2z1O1V5Z9XWjRFkFYuzLBc
https://mega.nz/#!JdcQnRiI!GeOJDpRXQXXWb5Xu4AyQ1Zn3CKZkEXhus4OdJC7E8V4

Thanks.
  • Author
  • Localization

id-daemon, posted Tue Apr 05, 2016 3:25 pm (12429)


You're asking to write a universal program, handling lots of formats, not an easy task.

Can you at least say, why do you need that?
  • Author
  • Localization

AnonBaiter, posted Tue Apr 05, 2016 7:01 pm (12439)


id-daemon wrote:
Can you at least say, why do you need that?

Because by then I wouldn't have to waste any time to extract the streamed files manually(unless it contains sequenced music data of course).
  • Author
  • Localization

aluigi, posted Thu Apr 07, 2016 6:16 pm (12469)


I guess I understand what you need but recognizing the single vag streams contained in a raw container (maybe by searching the aligned zeroes and the first seconds of silence) gives lot of false positives.
And the situation with channels and interleave is even worst.
Many years ago I tried that on the game The Warriors for PS2 and I had some success for most of the files so I tried to make a sort of "universal tool"... long story short, the tool is no longer indexed on my website due to the various false positives.
  • Author
  • Localization

id-daemon, posted Fri Apr 08, 2016 3:54 pm (12476)


Luigi, can you confirm the situation as I understand it.

Currently there's no tool to extract PS2/PS3 files with VAG codec, just because there are too many different formats in every game. So the only way is to detect everything in HEX editor, and manually extract it through GENH in VGMToolbox?

Am I right?
  • Author
  • Localization

AnonBaiter, posted Fri Apr 08, 2016 10:15 pm (12494)


Yes you are. Thanks for the help.
  • Author
  • Localization

aluigi, posted Sat Apr 09, 2016 4:29 pm (12515)


@id-daemon
Without a header or a constant it's impossible to guess where a raw audio starts and ends, the number of channels and other information (like bits for pcm or interleave for stereo vag or coeff for gamecube adpcm).
So the silence (sequence of zeroes) can be considered the only starting point of raw audio.
It's necessary to have the toc.
  • Author
  • Localization

id-daemon, posted Sat Apr 09, 2016 5:25 pm (12523)


What about PSound? What is it and how does it work?
  • Author
  • Localization

AnonBaiter, posted Sat Apr 09, 2016 5:39 pm (12525)


id-daemon wrote:
What about PSound? What is it and how does it work?

It detects PSX/PS2 files for playback. For more information, see here:
http://www.romhacking.net/utilities/679/
  • Author
  • Localization

id-daemon, posted Sat Apr 09, 2016 5:53 pm (12527)


And how many files can it detect? I've heard sometimes it detects wrong, and its only noise, or distorted sound.
  • Author
  • Localization

AnonBaiter, posted Sat Apr 09, 2016 6:07 pm (12528)


id-daemon wrote:
And how many files can it detect? I've heard sometimes it detects wrong, and its only noise, or distorted sound.

That we have yet to discover. If it's headerless, then it's certainly not going to bring up good results.
  • Author
  • Localization

id-daemon, posted Sun Apr 10, 2016 8:11 am (12537)


Then what do you mean by this:

AnonBaiter wrote:
kind of like PSound, except it has to be extracted at a raw format.

?
  • Author
  • Localization

AnonBaiter, posted Sun Apr 10, 2016 6:53 pm (12551)


id-daemon wrote:
Then what do you mean by this:

AnonBaiter wrote:
kind of like PSound, except it has to be extracted at a raw format.

?

Raw RIFF WAVE format.
  • Author
  • Localization

id-daemon, posted Sun Apr 10, 2016 7:09 pm (12552)


RIFF WAVE is not a raw format. What do you mean?
  • Author
  • Localization

AnonBaiter, posted Mon Apr 11, 2016 12:47 am (12557)


id-daemon wrote:
RIFF WAVE is not a raw format. What do you mean?

What I mean is that I didn't realize I was just mistaking it for an actual streamed format.
  • Author
  • Localization

id-daemon, posted Mon Apr 11, 2016 5:36 pm (12565)


Well, as Luigi said, it is very hard, if not impossible, to automatically detect VAG streams. Sample rate is absolutely impossible to detect, that's not even a question. But maybe there's a way to make some things a little easier.

So can you be more specific, do you need it for music (that is usually stereo), or SFX too? Are you talking about detecting VAG streams inside of a big archive file, whenever it is, or just from an unknown audio container (i.e. file with audio only)?

Because one of examples you provided is a full game archive, and another one is a raw audio container. And none of them has any headers, like VAG, SS2, or anything else.
  • Author
  • Localization

AnonBaiter, posted Mon Apr 11, 2016 8:04 pm (12567)


id-daemon wrote:
So can you be more specific, do you need it for music (that is usually stereo), or SFX too? Are you talking about detecting VAG streams inside of a big archive file, whenever it is, or just from an unknown audio container (i.e. file with audio only)?

Maybe both.
  • Author
  • Localization

id-daemon, posted Mon Apr 11, 2016 8:09 pm (12569)


Both in both questions?
  • Author
  • Localization

AnonBaiter, posted Mon Apr 11, 2016 10:20 pm (12571)


id-daemon wrote:
Both in both questions?

I meant exactly that.
  • Author
  • Localization

id-daemon, posted Tue Apr 12, 2016 10:54 am (12579)


In this case (such a universal tool) I doubt it will be possible to make something useful in at least 50% cases. Anyway, I will notify you about the results.
  • Author
  • Localization

aluigi, posted Tue Apr 12, 2016 4:32 pm (12601)


Just for reference, the following is the tool that I wrote many years ago and it's no longer indexed on my website:
http://aluigi.org/papers/vagguess.zip

As you can imagine there is and there will be no support from me.
  • Author
  • Localization

AnonBaiter, posted Tue Apr 12, 2016 5:50 pm (12602)


aluigi wrote:
the following is the tool that I wrote many years ago and it's no longer indexed on my website

No worries pal, I already got your tool.
  • Author
  • Localization

id-daemon, posted Sat Apr 16, 2016 7:16 am (12626)


The first results are good. The tool can detect VAG streams in 99% cases. There are some false positives and false negatives depending on settings, but at least I think we'll be able to detect audio inside of archives (like in examples you uploaded here)
  • Author
  • Localization

id-daemon, posted Sat Apr 16, 2016 12:42 pm (12630)


Here's the first experimental version. Works only with mono files now.

What it does:

Scan the whole file by 256-byte blocks trying to detect VAG stream analyzing its statistical data. Can detect VAGs with any alignment (even if it starts, say, from offset 0x5B07). Then read the stream until the end-of-stream flag and dump it.

No good detection for stream start yet, and no support for interleaving.
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.