The Forum is up for sale: XeNTaX Forum looking for new owner
WWise RIFF Vorbis format?
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
WWise RIFF Vorbis format?
Hi,
(Recently?) CCP changed all their music into a custom ".ogg" format which turns out to be Vorbis inside a custom RIFF container identified as "WAVE" and has nothing to do with Ogg.
A sample file is here: http://dl.getdropbox.com/u/773354/1.riffvorb
Here's what I know so far:
There are 3 blocks in the RIFF file, "fmt ", "vorb" and "data". "fmt " seems to be the same as in a WAVE file and has valid data but the format is set to 0xFFFF.
Update: "fmt " turned out to be quite a bit larger, there's some extra data there.
"vorb" is 44 bytes, not sure what it is yet. Probably needed to play the file.
"data" seems to be a (raw?) Vorbis stream, you can find the three first Vorbis headers by looking for:
0x01"vorbis" (the identification header)
0x03"vorbis" (the comments header)
0x05"vorbis" (the "codebooks" header)
8 bytes before each header there's a 32-bit int that says how large the header is. The problem I have is that I don't know where each Vorbis audio packet begins and ends.
I've written a small program in C (with very messy code) that extracts the 3 first Vorbis headers and puts them in a proper Ogg file. It's identified as a valid music file but with 0 length as I don't know how to put the Vorbis packets in Ogg pages. You can download it here: http://dl.getdropbox.com/u/773354/extract.zip
Updated:
The format turns out to be "audiokinetics wwise", they use their own container for Vorbis etc. I downloaded their SDK but it doesn't seem possible to play the files without the original project. But at least it helps quite a bit...
(Recently?) CCP changed all their music into a custom ".ogg" format which turns out to be Vorbis inside a custom RIFF container identified as "WAVE" and has nothing to do with Ogg.
A sample file is here: http://dl.getdropbox.com/u/773354/1.riffvorb
Here's what I know so far:
There are 3 blocks in the RIFF file, "fmt ", "vorb" and "data". "fmt " seems to be the same as in a WAVE file and has valid data but the format is set to 0xFFFF.
Update: "fmt " turned out to be quite a bit larger, there's some extra data there.
"vorb" is 44 bytes, not sure what it is yet. Probably needed to play the file.
"data" seems to be a (raw?) Vorbis stream, you can find the three first Vorbis headers by looking for:
0x01"vorbis" (the identification header)
0x03"vorbis" (the comments header)
0x05"vorbis" (the "codebooks" header)
8 bytes before each header there's a 32-bit int that says how large the header is. The problem I have is that I don't know where each Vorbis audio packet begins and ends.
I've written a small program in C (with very messy code) that extracts the 3 first Vorbis headers and puts them in a proper Ogg file. It's identified as a valid music file but with 0 length as I don't know how to put the Vorbis packets in Ogg pages. You can download it here: http://dl.getdropbox.com/u/773354/extract.zip
Updated:
The format turns out to be "audiokinetics wwise", they use their own container for Vorbis etc. I downloaded their SDK but it doesn't seem possible to play the files without the original project. But at least it helps quite a bit...
Last edited by Anders Bergh on Sat May 23, 2009 7:41 am, edited 3 times in total.
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: EVE Online Vorbis in RIFF container
I uploaded the program I wrote to extract the ogg but it's very ugly code. It was written on Linux and it's used like: make && ./ro music.riffvorbis and creates "anders.ogg". Needs libogg installed.
http://dl.getdropbox.com/u/773354/extract.zip
http://dl.getdropbox.com/u/773354/extract.zip
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: EVE Online Vorbis in RIFF container
(the download links are fixed now)
Last edited by Anders Bergh on Wed May 13, 2009 10:11 pm, edited 1 time in total.
- asmxtx
- veteran
- Posts: 127
- Joined: Sun Jun 08, 2008 10:32 pm
- Location: Developers Country
- Has thanked: 1 time
- Been thanked: 30 times
Re: EVE Online Vorbis in RIFF container
Use MEGAUPLOAD.COM, NETLOAD.IN, 4SHARED.COM.
They don't make any problems and are very frendly for nonpaying downloading users.
They don't make any problems and are very frendly for nonpaying downloading users.
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: EVE Online Vorbis in RIFF container
http://dl.getdropbox.com/u/773354/extract.zip for my C source code (very ugly)asmxtx wrote:Use MEGAUPLOAD.COM, NETLOAD.IN, 4SHARED.COM.
They don't make any problems and are very frendly for nonpaying downloading users.
http://dl.getdropbox.com/u/773354/1.riffvorb for the example file
These work now.
- Savage
- VIP member

- Posts: 559
- Joined: Sun Apr 17, 2005 11:00 am
- Has thanked: 16 times
- Been thanked: 18 times
Re: WWise RIFF Vorbis format?
Thanks for make this unpacker/conversor i tried under Slamd64 and GCC 4.2.3, when i compile i get:
and then if i analyze the ogg
and
Code: Select all
vorbis.c:110: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
vorbis.c:170: warning: format '%d' expects type 'int', but argument 2 has type 'ogg_int64_t'
Code: Select all
New logical stream (#1, serial: deadbeef): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: AO; aoTuV b4b [20051117] (based on Xiph.Org's libVorbis)
Channels: 2
Rate: 48000
Nominal bitrate: 48,000000 kb/s
Upper bitrate not set
Lower bitrate not set
Negative or zero granulepos (-1) on vorbis stream outside of headers. This file was created by a buggy encoder
...
Code: Select all
Total data length: 103036 bytes
Playback length: 0m:00.000s
Average bitrate: inf kb/s

-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
Yeah, it's broken. I don't know the audio packet boundaries so all the generated .ogg has is the 3 first headers.Savage wrote:Thanks for make this unpacker/conversor i tried under Slamd64 and GCC 4.2.3, when i compile i get:and then if i analyze the oggCode: Select all
vorbis.c:110: warning: format '%d' expects type 'int', but argument 2 has type 'size_t' vorbis.c:170: warning: format '%d' expects type 'int', but argument 2 has type 'ogg_int64_t'andCode: Select all
New logical stream (#1, serial: deadbeef): type vorbis Vorbis headers parsed for stream 1, information follows... Version: 0 Vendor: AO; aoTuV b4b [20051117] (based on Xiph.Org's libVorbis) Channels: 2 Rate: 48000 Nominal bitrate: 48,000000 kb/s Upper bitrate not set Lower bitrate not set Negative or zero granulepos (-1) on vorbis stream outside of headers. This file was created by a buggy encoder ...Code: Select all
Total data length: 103036 bytes Playback length: 0m:00.000s Average bitrate: inf kb/s
- Savage
- VIP member

- Posts: 559
- Joined: Sun Apr 17, 2005 11:00 am
- Has thanked: 16 times
- Been thanked: 18 times
Re: WWise RIFF Vorbis format?
Maybe here we get some clues
http://www.hydrogenaudio.org/forums/ind ... opic=69941
PS: lol, 4 years here
http://www.hydrogenaudio.org/forums/ind ... opic=69941
PS: lol, 4 years here

-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
I will look into all this again and post everything I know so far. Haven't really touched this in a while now...Savage wrote:Maybe here we get some clues
http://www.hydrogenaudio.org/forums/ind ... opic=69941
PS: lol, 4 years here
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
I have "figured" the format out enough to convert the files to playable Ogg Vorbis. You can find the converter here:
http://andersman.org/~anders/wwiseconv.py
It requires Python 2.5+ and mutagen.
This should work for other games using WWise as well, but I don't have any. Also, when I tried the latest WWise SDK and encoded some Vorbis stuff it seems they changed the format...
http://andersman.org/~anders/wwiseconv.py
It requires Python 2.5+ and mutagen.
This should work for other games using WWise as well, but I don't have any. Also, when I tried the latest WWise SDK and encoded some Vorbis stuff it seems they changed the format...
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
Code: Select all
#!/usr/bin/env python2.6
import os
import sys
import struct
from uuid import UUID
input_file = '/Applications/EVE Online.app/Contents/Resources/transgaming/c_drive/Program Files/CCP/EVE/res/Audio/128526931.ogg'
def parse(stream):
save = {}
magic, file_size, file_type = struct.unpack('<4sL4s', stream.read(12))
print "magic: %s file_size: %d file_type: %s" % (magic, file_size, file_type)
while stream.tell() <= file_size:
chunk, size = struct.unpack('<4sL', stream.read(8))
print " chunk: '%s' size: %d" % (chunk, size)
if chunk == 'fmt ':
(format, channels, samples_per_sec, avg_bytes_per_sec, blockalign,
bits_per_sample, size, valid_bits, channel_mask, guid) = struct.unpack('<HHLLHHHHL16s', stream.read(size))
uuid = UUID(bytes=guid)
print " format: %02x; channels: %d; rate: %d; avgbytes: %d" % (format, channels, samples_per_sec, avg_bytes_per_sec)
print " bits_per_sample: %d size: %d valid_bits: %d channel_mask: %d" % (bits_per_sample, size, valid_bits, channel_mask)
print " guid: {%s}" % str(uuid)
save['rate'] = samples_per_sec
elif chunk == 'vorb':
data = stream.read(size)
samples, a, b, c, d, audio_size, f, g, h, i, j = struct.unpack('<LLLLLLLLLLL', data)
save['audio_size'] = audio_size
song_len = samples // save['rate']
print " samples: %d audio_size: %d" % (samples, audio_size)
print " samples / %d = %0.2f secs" % (save['rate'], song_len)
elif chunk == 'data':
orig_pos = stream.tell()
ident_size, unknown1 = struct.unpack('<LL', stream.read(8))
ident = stream.read(ident_size)
comments_size, unknown2 = struct.unpack('<LL', stream.read(8))
comments = stream.read(comments_size)
codebooks_size, unknown3 = struct.unpack('<LL', stream.read(8))
codebooks = stream.read(codebooks_size)
print " chunk_size - audio_size = %d" % (size - save['audio_size'])
print " ident_size: %d comments_size: %d codebooks_size: %d" % (ident_size, comments_size, codebooks_size)
print " unknown1: %d unknown2: %d unknown3: %d" % (unknown1, unknown2, unknown3)
packets = 0
while stream.tell() < size + orig_pos:
packet_size, granule = struct.unpack('<LL', stream.read(8))
# need to figure out these
if granule == 0:
print " [%d] granule = %d; size = %d" % (packets, granule, packet_size)
print " %s" % repr(stream.read(packet_size))
else:
stream.seek(packet_size, os.SEEK_CUR)
packets = packets + 1
print " found %d vorbis packets" % packets
extra = stream.read(size - save['audio_size'])
print len(extra)
else:
print " skipping chunk"
stream.seek(size, os.SEEK_CUR)
print ""
if len(sys.argv) == 2:
input_file = sys.argv[1]
print "== %s ===========" % input_file
f = open(input_file, 'rb')
parse(f)I need to figure out the fields in "vorb" and the 2 initial packets in the "data" chunk (after the 3 vorbis headers).
-
hcs
- mega-veteran

- Posts: 263
- Joined: Sun Oct 18, 2009 9:41 pm
- Location: Portland, OR
- Has thanked: 3 times
- Been thanked: 79 times
- Contact:
Re: WWise RIFF Vorbis format?
Apparently Assassin's Creed 2 uses a later version of this format. I made a converter that converts that to normal Ogg Vorbis. The biggest oddity is that codebooks are stored external to the file. Other than that, maybe you're dealing with the same kind of corner-cutting (leaving out reserved or unneeded fields) that I did, it might be helpful for reference. I doubt it's 100% correct yet, but it pretty much works.
http://hcs64.com/files/ww2ogg00.zip
http://hcs64.com/files/ww2ogg00.zip
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
I'll have a look, but I downloaded the Wwise SDK and the codebooks are stored within the .ogg files. There is only one difference: in the Vorbis specification there is a set of "time books" (?) and these are simply not included in the Wwise Vorbis files, so you have to parse the whole codebooks then rewrite them but with the times also. That's only 6 bits or so.hcs wrote:Apparently Assassin's Creed 2 uses a later version of this format. I made a converter that converts that to normal Ogg Vorbis. The biggest oddity is that codebooks are stored external to the file. Other than that, maybe you're dealing with the same kind of corner-cutting (leaving out reserved or unneeded fields) that I did, it might be helpful for reference. I doubt it's 100% correct yet, but it pretty much works.
http://hcs64.com/files/ww2ogg00.zip
Codebooks are different for every encoder and also encoded file, usually, so that you could just embed some other codebooks is quite interesting...
Reading the code at the moment and just saw that you figured out the vorb header!!! Great! I then can fix my new converter (at http://bitbucket.org/anders/wwiseconv) which currently only works for some files, because I reverse engineered the Wwise SDK and put a breakpoint on vorbis_info_init which gets blocksize0 and blocksize1 passed to it!
Stay tuned
PS: I see you parsed the codebooks yourself, perhaps you've noticed I was a bit lazy: I just copied libvorbis and added a "dst" oggpack_buffer to every read function.. so they copy everything, and when they get to the time stuff it just writes that.
-
Anders Bergh
- n00b
- Posts: 18
- Joined: Tue May 12, 2009 11:28 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: WWise RIFF Vorbis format?
I just committed some new changes to my repository, still doesn't work for some files (blocksize_0_pow / blocksize_1_pow seems to be 8 / 11 for these files).
I know the code is really ugly, sorry for that :\
I know the code is really ugly, sorry for that :\
