I'm ripping sounds from Star Wars Battlefront 2 PS2 and I seem to be messing the number of channels in the extracted vag header.
I'm referring to the following:
https://wiki.xentax.com/index.php/VAG_Audio
And have the following code implemented:
https://github.com/BAD-AL/SoundFMVextra ... in.vb#L198
Anyone know what to do to mark the number of channels properly in a .vag header?
Or if you could point me to a stereo .vag file I could study, that would be cool too.
VAG File header help
-
- Posts: 367
- Joined: Fri Mar 10, 2017 7:23 am
Re: VAG File header help
VAG is usually always in mono, though some devs have added their stereo variations of it (e.g. in NFS Hot Pursuit 2, it contains usual VAG header but Blackbox modifies the headers a little). You can try to study the vgmstream codes for handling those files here: https://github.com/vgmstream/vgmstream/ ... meta/vag.c
-
- Posts: 3
- Joined: Sun Apr 24, 2022 11:46 pm
Re: VAG File header help
Well...
Looks like they are using hardcoded knowledge to set the number of channels in there.
Battlefront 2 does mostly have mono sounds (sound fx & voice) but the music and ambiance is 2 channel (in the XBOX and PC versions at least).
Maybe you can point me to a 2-channel .vag file on the internet somewhere?
Looks like they are using hardcoded knowledge to set the number of channels in there.
Battlefront 2 does mostly have mono sounds (sound fx & voice) but the music and ambiance is 2 channel (in the XBOX and PC versions at least).
Maybe you can point me to a 2-channel .vag file on the internet somewhere?
-
- Posts: 367
- Joined: Fri Mar 10, 2017 7:23 am
Re: VAG File header help
BAD_AL wrote:Well...
Looks like they are using hardcoded knowledge to set the number of channels in there.
Battlefront 2 does mostly have mono sounds (sound fx & voice) but the music and ambiance is 2 channel (in the XBOX and PC versions at least).
Maybe you can point me to a 2-channel .vag file on the internet somewhere?
Here you can use the sample I've provided (from NFS Hot Pursuit 2)
https://drive.google.com/file/d/12EQFyN ... sp=sharing
Anyway, the most important things I can tell you is, VAG is just a container, it's the content that matters. A stereo PlayStation ADPCM usually consist of two mono streams (well of course duh), interleaved at certain bytes (Must be multiply of 0x10/16-bytes; It's up to the devs which amounts they want to use). Also, there's a lot of other games that don't use any headers at all (or didn't include the interleave values on it's header), and just interleave the streams. To find where the interleave starts for this kind of file, look for the second occurrence of 16-bytes of zeroes (Usually it's close from the start of the files). However, things getting hard for the files that immediately starts without those zeroes.
-
- Posts: 3
- Joined: Sun Apr 24, 2022 11:46 pm
Re: VAG File header help
After a little more thinking & listening, I think they actually achieve stereo by interleaving the tracks.
So no more changes needed I guess.
Thanks for the info BloodRaynare
So no more changes needed I guess.
Thanks for the info BloodRaynare