RIFX Ogg vorbis file by OrangeC at 1:16 PM EST on November 30, 2009
I have a file here that seems to be a vorbis format but has a rifx header, is this mixed wav/ogg hybrid or something because i cannot get it to decode.

It is from assassins creed 2 360.

http://www.megaupload.com/?d=XZM6INA6
by asdf at 4:16 PM EST on November 30, 2009
?
by OrangeC at 4:21 PM EST on November 30, 2009
saw that but is there anyway to decode?
by asdf at 4:23 PM EST on November 30, 2009
convert the byte order?
by asdf at 4:30 PM EST on November 30, 2009
i'd wait for hcs to write a scrip or provide some insight personally :)
by bxaimc at 4:35 PM EST on November 30, 2009
This looks familiar. I remember someone taking a look at OGG with RIFX headers before, I can't remember whether it was manakoAT or hcs though.
by pietastesgood at 6:08 PM EST on November 30, 2009
I'm waiting with bated breath for more information.
by hcs at 7:54 PM EST on November 30, 2009
RIFX is just big endian RIFF, but that doesn't help him, as RIFF Vorbis is itself tricky to deal with. FastElbja brought these to my attention a while ago, and while I know in general how to deal with them I haven't been able to go through all the fun to actually implement it.
by pietastesgood at 9:13 PM EST on November 30, 2009
So basically, this Riff Vorbis is an ogg file with a fake Rifx header?

Would there be any other way besides adding on the original full ogg header to make this decode?
by hcs at 12:49 AM EST on December 1, 2009
The problem is that Ogg doesn't enter into it at all, it's a raw Vorbis stream. Without the Ogg wrapped around it the normal library can't do anything with it. It isn't just a matter of a header, the whole stream would need to be repackaged. There's likely a way to set up the Vorbis decoder to work directly with this file, though I don't know how to go about it. Some day...
by OrangeC at 5:30 AM EST on December 1, 2009
Damn well okay thanks for the info.
by hcs at 7:14 AM EST on December 1, 2009
Seems similar to what's discussed for EVE Online, with RIFX instead of RIFF.

That makes it Audiokinetic Wwise, as their site confirms, which has a custom Vorbis implementation. It looks like they've made their format even less standard now, though, as there aren't any identifying strings from a normal Vorbis stream. I can identify a few aspects of the structure, but I don't really know enough to be able to tackle this. Yet.

edited 7:16 AM EST December 1, 2009

Hmm, release notes for 2009.3 say:

Codebooks have been removed from the Vorbis file headers and moved to
a decoder library resulting in less runtime memory usage, less space taken
on DVD, and smaller prefetch loaded in RAM.


Which would explain why I couldn't find anything looking like a standard codebook.

edited 7:22 AM EST December 1, 2009
by OrangeC at 7:35 AM EST on December 1, 2009
Yes in the credits for the game it said: it used the WWise. I don't suppose theres any SDK for the WWise tools?
by hcs at 7:41 AM EST on December 1, 2009
You can get the SDK from their site (the form doesn't need a valid email). I haven't tried it on these files yet. The EVE guys didn't have any luck and they were trying it with PC games, it's fairly likely that the 360 version is different enough that it's totally unsupported.
by OrangeC at 8:07 AM EST on December 1, 2009
yes ive had no luck here either, i found the vorbis decoder lib but im guessing thats probably not useful in this case.
by hcs at 8:52 AM EST on December 1, 2009
I'm having a look at it anyway. I looked at the RIFF .ogg files this produces, they seem similar enough to the RIFX that it might be the same version. In particular it looks like the same situation with the codebooks being left out and instead part of the library. It looks like their decoder is a wrapper around Tremor so hopefully I won't have to go too deep.
by OrangeC at 9:49 AM EST on December 1, 2009
Okay thanks hcs.
by pietastesgood at 6:05 PM EST on December 1, 2009
Great HCS!
by hcs at 3:54 AM EST on December 4, 2009
Ok, this does essentially the right thing.
ww2ogg 0.0 converts Audiokinetic Wwise RIFF/RIFX Vorbis to normal Ogg Vorbis. packed_codebook.bin is extracted from the SDK and is needed for the converter to work, as the codebooks aren't stored in the file anywhere. The format is pretty much the same as the standard besides that, but with reserved and unused fields left out of the setup bitstream.
Worked on the one AC2 file you gave, I think. Those of you who know what it sounds like will have a better idea.
by OrangeC at 6:20 AM EST on December 4, 2009
Your awesome man thanks.

It appears im getting an error in some files with this header.

http://www.megaupload.com/?d=YZSCWFN8

Gives me unknown chunk type.



edited 6:58 AM EST December 4, 2009
old WWise version by Min Kaa Lay at 8:01 AM EST on December 4, 2009
Hello there and thx for the great work hcs - there is still no converter for this codec except your one ;)


I have found a older WWise RIFF Vorbis codec version inside this game:
http://www.megaupload.com/?d=GZWFSANR

The codebook is still there but i dont know how i should handle these tracks with your converter.

thx hcs
by hcs at 9:53 AM EST on December 4, 2009
Here's a fix for the other AC2 ones with some more chunks, apparently for looping: ww2ogg 0.1

I'll take a look at the old file later.

One more fix, handle subtype with no seek table: ww2ogg 0.2

edited 10:32 AM EST December 4, 2009

A little more handling for cuepoint lists (just ignored). ww2ogg 0.3

At this point it should work with everything from Assassin's Creed 2, except for 470157058.wav which is XMA2. xma_parse can pull out the stream like so:
xma_test 470157058.wav -o 800 -b 10000 -r 470157058.bin

It's cut off, but I assume that's because it should loop.

edited 8:53 PM EST December 4, 2009
by pietastesgood at 9:31 PM EST on December 4, 2009
NICE!! Thanks so much HCS!
by OrangeC at 6:57 AM EST on December 5, 2009
Thanks hcs, works great now.
by hcs at 1:30 AM EST on January 17, 2010
Just wanted to give an update to this old thread, I added support for the Divinity 2 style files in ww2ogg 0.7. Unfortunately the files banks, so you have to use some method to cut out the RIFF chunks so that ww2ogg can deal with them. Just splitting everything from one RIFF to the next RIFF will do.
by kode54 at 9:26 PM EST on February 27, 2014
It seems that ffmpeg chokes on some of the files ww2ogg produces, at least from the Batman: Arkham City rip. This, in turn, breaks recent versions of foobar2000.
by hcs at 4:16 PM EST on March 3, 2014
My first guess is that the wrong packed codebooks are being used, is this not the case?

My second guess is that revorb was not used to clean up the files, fb2k is unusually sensitive to screwed up granulepos.
by kode54 at 9:02 PM EST on March 3, 2014
I shared the files with a fellow foobar developer, and he says the ww2ogg version is five releases behind.

"converted from Audiokinetic Wwise by ww2ogg 0.16"

Specifically, "012 - BAC012.ogg" from the Batman: Arkham City rip. The code books seem to be fine, as it decodes with plain libvorbis. The trumpets sound a little scrapy, or weird, but it plays for the full duration.

In foobar2000 and ffmpeg, whole packets seem to be dropped seemingly at random, causing the duration to be almost a full minute less than the last granulepos reports.
by hcs at 2:46 PM EST on March 4, 2014
Hm, at 0.16 there's some chance it has to do with the prev/next window type bits not being set properly for the modified packet format; ww2ogg doesn't rebuild those correctly until 0.19.

libvorbis doesn't use those hints but others do, and revorb doesn't attempt to fix them. If you could throw an example file up I could confirm/deny this.

If this is the trouble it should be possible to fix even without reference to the original files.

edited 2:48 PM EST March 4, 2014
by kode54 at 8:32 PM EST on March 4, 2014
Here you go:

https://dl.dropboxusercontent.com/u/2425906/012%20-%20BAC012.zip

EDIT: This file is supposedly from a game rip of Arkham City, and supposedly, the DLC rip does not have this problem, so perhaps the ripper updated their tools? The original game rip needs to be fixed still.

edited 8:33 PM EST March 4, 2014
by hcs at 2:12 AM EST on March 5, 2014
Yeah it looks like the bits are unset.

An illustrative piece of output from vorbose:


info packet: decoding Vorbis stream packet 206
packet mode : 0
block size : 256

info packet: decoding Vorbis stream packet 207
packet mode : 1
block size : 2048
previous : 256
next : 256

info packet: decoding Vorbis stream packet 208
packet mode : 1
block size : 2048
previous : 256
next : 256

info packet: decoding Vorbis stream packet 209
packet mode : 1
block size : 2048
previous : 256
next : 256


Those previous and next numbers should indicate the previous and next block size. Instead it is always reporting that the neighbors are short blocks, which means the decoder may use the wrong window or lapping (see the spec for details).

All the information is there to fix this, it only wants someone to do it. This may not be the only problem, but it is definitely one of them.

edited 2:13 AM EST March 5, 2014
by kode54 at 7:30 PM EST on March 5, 2014
Well, if anyone wants to fix revorb, the source is available:

http://yirkha.fud.cz/progs/foobar2000/revorb.cpp

And with little modification, it could be compiled outside of Windows.

The way I see it, it would need to buffer a full packet ahead on the input file, and keep track of the size of the previous packet, where applicable. Then it could easily regenerate that information for the output packets.

Hmm...

EDIT: It would be most helpful if you could tell me which structure those previous and next members are a part of. Is it the ogg packet, or is it something specific to Vorbis?

edited 11:30 PM EST March 5, 2014
by hcs at 11:26 AM EST on March 6, 2014
Purely Vorbis.

Here's the relevant code from ww2ogg 0.21. Note that this depends on knowing the modes set up for this particular file, the long/short specification is per mode, (vorbis_blockflag) and packets only say what mode they use. As these bits are at the very beginning of a vorbis packet I don't have to deal with parsing the whole packet, I just read the mode bits and insert the window bits if it is a long packet.

gist


edited 11:48 AM EST March 6, 2014

Probably should have been more explicit, this code inserts the packet type bit (always 0) and optionally the prev/next window bits into the wwise packet, which misses them entirely. You will want, instead, to replace the window bits (which were always filled in 0 in an older version of ww2ogg).

edited 11:57 AM EST March 6, 2014

edited 11:59 AM EST March 6, 2014


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source