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

Codecs, formats, encoding/decoding of game audio, video and music
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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.
Last edited by AnonBaiter on Tue Apr 05, 2016 11:43 pm, edited 1 time in total.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

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?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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).
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

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?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

Yes you are. Thanks for the help.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

@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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

What about PSound? What is it and how does it work?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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/
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

And how many files can it detect? I've heard sometimes it detects wrong, and its only noise, or distorted sound.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

Then what do you mean by this:

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

?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

RIFF WAVE is not a raw format. What do you mean?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

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.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

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.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

Both in both questions?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

id-daemon wrote:Both in both questions?

I meant exactly that.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

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

Post by id-daemon »

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.