Important information: this site is currently scheduled to go offline indefinitely by end of the year.

4-channel MP3 XVAG... Anyone know how to extract them?

Get help on any and all audio formats, or chip in and help others!
Post Reply
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

Hi Everyone!
I've been lurking around here for some time but just registered as I'm hoping someone out there can help. I'm trying to do my first game soundtrack rip and I've hit a snag when dealing with MP3 XVAG files. The game I'm ripping is a PSN title that uses XVAG for its audio storage. Several of the XVAG files are 2-channel MP3s that extract just fine using Nova Software Extractor, and play perfectly using the VGMStream Winamp plugin.

Unfortunately, the bulk of the music in the game seems to be 4-channel audio which no program I have found can correctly deal with. I've uploaded a small sample file here:

http://www.mediafire.com/?95spwnjd7cd6boj

I'm hoping someone can have a look at this and find a way to extract these into two separate 2-channel MP3s. I can also upload a working 2-channel XVAG from the same game if it helps figure out the problem.
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

113 views and no suggestions eh? I can't believe I stumped you all! I'm still interested in pursuing this if anyone has any ideas.

Thanks!
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by fadi002 »

The programs that work the most for Journey's audio files are VLC media player and Audacity with FFmpeg. They mess up the file, but it's still recognizable. That's all I can do to help you.
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by fadi002 »

I had a similiar problem, and discovered a way to fix these files. Here is the thread that explains how to do it: viewtopic.php?f=17&t=8754. The file you have is very similar to the ones I mentioned in my thread, so it should work, but you have to use different values in the script.
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

fadi002 wrote:I had a similiar problem, and discovered a way to fix these files. Here is the thread that explains how to do it: viewtopic.php?f=17&t=8754. The file you have is very similar to the ones I mentioned in my thread, so it should work, but you have to use different values in the script.
Thank you! This seems like it's on the right track. The only thing I can't figure out is how to calculate the interleave. I looked at your sample 789_sandlantis_doorwalkthrough.xvag that you posted and you found an interleave of 0x2A00, but I can't for the life of me figure out how you determined that value. Every occurrence of FFFB seems to be exactly 768 bytes apart, which is 0x300 in hex... so if you could shed some light on how you came up with 0x2A00, I'd really appreciate it.

Thanks!
OrangeC
double-veteran
double-veteran
Posts: 868
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 41 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by OrangeC »

The interleave isn't exactly after the first frame, you have to keep going frame by frame to determine the interleave offset.
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by fadi002 »

AchillesPDX wrote:
fadi002 wrote:I had a similiar problem, and discovered a way to fix these files. Here is the thread that explains how to do it: viewtopic.php?f=17&t=8754. The file you have is very similar to the ones I mentioned in my thread, so it should work, but you have to use different values in the script.
Thank you! This seems like it's on the right track. The only thing I can't figure out is how to calculate the interleave. I looked at your sample 789_sandlantis_doorwalkthrough.xvag that you posted and you found an interleave of 0x2A00, but I can't for the life of me figure out how you determined that value. Every occurrence of FFFB seems to be exactly 768 bytes apart, which is 0x300 in hex... so if you could shed some light on how you came up with 0x2A00, I'd really appreciate it.

Thanks!
Well, initially I just kept guessing and trying every number by adding or subtracting 0x300 to the number that didn't work (I started at 3000). But I just figured out an easier way. Keep looking at the contents of every frame (what's in between the FFFB values) and notice any patterns (usually, in the beginning, it's one repeated ascii character). Keep counting the frames, and when you see the pattern change, remember the number of that frame. Convert that number to hex, then multiply 0x300 by that number. (Here's a hex calculator: http://www.squarebox.co.uk/hcalc.html) So if the number you counted was 16, the interleave would be 3000. If you get it wrong, try adding 0x300 or subtracting 0x300. If it still doesn't work, look at the patterns more carefully.

Oh, and btw, the frame value is the address of the character that's before the first frame (for example, if the first frame starts with 11 00 FF FB D4, the frame value would be the address of the 00)
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

fadi002 wrote:
AchillesPDX wrote:
fadi002 wrote:I had a similiar problem, and discovered a way to fix these files. Here is the thread that explains how to do it: viewtopic.php?f=17&t=8754. The file you have is very similar to the ones I mentioned in my thread, so it should work, but you have to use different values in the script.
Thank you! This seems like it's on the right track. The only thing I can't figure out is how to calculate the interleave. I looked at your sample 789_sandlantis_doorwalkthrough.xvag that you posted and you found an interleave of 0x2A00, but I can't for the life of me figure out how you determined that value. Every occurrence of FFFB seems to be exactly 768 bytes apart, which is 0x300 in hex... so if you could shed some light on how you came up with 0x2A00, I'd really appreciate it.

Thanks!
Well, initially I just kept guessing and trying every number by adding or subtracting 0x300 to the number that didn't work (I started at 3000). But I just figured out an easier way. Keep looking at the contents of every frame (what's in between the FFFB values) and notice any patterns (usually, in the beginning, it's one repeated ascii character). Keep counting the frames, and when you see the pattern change, remember the number of that frame. Convert that number to hex, then multiply 0x300 by that number. (Here's a hex calculator: http://www.squarebox.co.uk/hcalc.html) So if the number you counted was 16, the interleave would be 3000. If you get it wrong, try adding 0x300 or subtracting 0x300. If it still doesn't work, look at the patterns more carefully.

Oh, and btw, the frame value is the address of the character that's before the first frame (for example, if the first frame starts with 11 00 FF FB D4, the frame value would be the address of the 00)
YEE HAW! Got it! Woo Hoo! Now to finish my rip! Thank you so much!

And of course each track uses a different interleave... goddammit...
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by fadi002 »

AchillesPDX wrote:
fadi002 wrote:
AchillesPDX wrote:
Thank you! This seems like it's on the right track. The only thing I can't figure out is how to calculate the interleave. I looked at your sample 789_sandlantis_doorwalkthrough.xvag that you posted and you found an interleave of 0x2A00, but I can't for the life of me figure out how you determined that value. Every occurrence of FFFB seems to be exactly 768 bytes apart, which is 0x300 in hex... so if you could shed some light on how you came up with 0x2A00, I'd really appreciate it.

Thanks!
Well, initially I just kept guessing and trying every number by adding or subtracting 0x300 to the number that didn't work (I started at 3000). But I just figured out an easier way. Keep looking at the contents of every frame (what's in between the FFFB values) and notice any patterns (usually, in the beginning, it's one repeated ascii character). Keep counting the frames, and when you see the pattern change, remember the number of that frame. Convert that number to hex, then multiply 0x300 by that number. (Here's a hex calculator: http://www.squarebox.co.uk/hcalc.html) So if the number you counted was 16, the interleave would be 3000. If you get it wrong, try adding 0x300 or subtracting 0x300. If it still doesn't work, look at the patterns more carefully.

Oh, and btw, the frame value is the address of the character that's before the first frame (for example, if the first frame starts with 11 00 FF FB D4, the frame value would be the address of the 00)
YEE HAW! Got it! Woo Hoo! Now to finish my rip! Thank you so much!

And of course each track uses a different interleave... goddammit...
What were the values?
I found out some (yes, more than one) of them have a header of 133, interleave of 1200, and 2 layers.

Edit: When I said what's bolded and underlined at the top, I meant multiply the number you found by the number of bytes each frame is, in hex. It's not always 300.
Last edited by fadi002 on Tue Apr 17, 2012 9:13 pm, edited 1 time in total.
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

Well the first file I tried (and these are from the game Journey) has header: 0xDC, Interleave: 1390 and Layers of 2.

The second file has the same length of header, and each frame seems to be the same length as the first file (626 bytes) but the interleave position is different and I haven't been able to find it yet.
AchillesPDX
beginner
Posts: 34
Joined: Fri Mar 16, 2012 6:02 pm
Has thanked: 4 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by AchillesPDX »

Well, it's a pain in the ass, but I figured out a solution. You can easily find the Interleave by looking at the end of the file and finding the huge patches of "00 00 00 00 00" and calculating the distance between the patches. Then you count the patches to get the number of layers. All that's left is to find the length of the header. Sadly, each one of my files seems to have different values for all of these things :(
brendan19
ultra-veteran
ultra-veteran
Posts: 389
Joined: Thu Aug 12, 2010 8:15 am
Has thanked: 54 times
Been thanked: 93 times

Re: 4-channel MP3 XVAG... Anyone know how to extract them?

Post by brendan19 »

Post Reply