Pages: 1 2 :: [one page] |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Anders1
Caldari Tech Nexus Gemini Federation
|
Posted - 2009.04.30 06:54:00 -
[1]
Edited by: Anders1 on 30/04/2009 07:00:00 Edited by: Anders1 on 30/04/2009 06:58:22 Edited by: Anders1 on 30/04/2009 06:58:06 So I was trying to listen to some of the EVE music, as I had done a year ago and it turned out the music was now in .ogg files. However, these files wouldn't play in any media player I tried... so I looked around and found out that these aren't actually Ogg at all. They're Vorbis in a RIFF container.
I extracted the Vorbis data (the chunk called "data" I believe), but there isn't a single app out there that will play a raw(?) Vorbis stream and I've given up trying to copy it into a proper .ogg. So, yeah, what's with the odd format? Anyone got any clue?
Here's the Python script I wrote to extract it, note that it's not any good code, works though... Copy one of the .ogg's from res/music and call it music.riffogg, and it will extract the data from it. There's a chunk called "vorb" that probably holds some vital information but I don't know what it is yet.
import struct
def get_chunk(f): header = f.read(8) id, size = struct.unpack('<4sI', header)
return id, size, f.read(size)
f = open('music.riffogg', 'r')
header = f.read(12)
riff, size, type = struct.unpack('<4sI4s', header)
assert riff == 'RIFF'
print 'RIFF file:' print 'File size: %d' % size print 'File type: "%s"' % type
def get_vorbis(f): while True: id, size, data = get_chunk(f) print id
if id == 'data': out = open('vorb.ogg', 'wb') out.write(data) out.close() print 'wrote vorbis data to vorb.ogg' return data
d = get_vorbis(f)
|

Anders1
Caldari Tech Nexus Gemini Federation
|
Posted - 2009.05.11 22:30:00 -
[2]
I've looked into this a bit more.
- fmt: A WAVE chunk, it seems to be filled with valid data: format: 65535 channels: 2 rate: 48000 bitrate:6000
- vorb (around 40 bytes): No idea. Probably important for something.
- data: the Vorbis stream, you can find vorbis headers in it. starts with 0x01 + vorbis, 0x03 + vorbis, 0x05 + vorbis for the first three ones. problem is how to find out where all the other vorbis packets begin and end...
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.05.12 08:49:00 -
[3]
Originally by: Anders1
- data: the Vorbis stream, you can find vorbis headers in it. starts with 0x01 + vorbis, 0x03 + vorbis, 0x05 + vorbis for the first three ones. problem is how to find out where all the other vorbis packets begin and end...
There is some file layout definitions up on msdn that might help you a bit in finding that out. _
Add your own line! |

Anders1
Caldari Tech Nexus Gemini Federation
|
Posted - 2009.05.12 12:52:00 -
[4]
Originally by: Sleepkevert
Originally by: Anders1
- data: the Vorbis stream, you can find vorbis headers in it. starts with 0x01 + vorbis, 0x03 + vorbis, 0x05 + vorbis for the first three ones. problem is how to find out where all the other vorbis packets begin and end...
There is some file layout definitions up on msdn that might help you a bit in finding that out.
Yeah, I've got the RIFF bit sorted. There are only 3 chunks (fmt , vorb and data). The problem is figuring out where the Vorbis packet boundaries begin and end in the data chunk.
So far I've got the third Vorbis packet sorted, I think. 8 bytes before the \x05vorbis string there's a 32-bit int which seems to be the length of that block (the codebook). But I have no idea about the rest of the file right now...
|

Hinaj Katsu
|
Posted - 2009.05.16 09:53:00 -
[5]
Did you made any progress? |

Anders1
Caldari Tech Nexus Gemini Federation
|
Posted - 2009.05.17 03:36:00 -
[6]
Originally by: Hinaj Katsu Did you made any progress?
I haven't really worked on it more, so no. But I hope to get it working at some point :)
|

Anders1
Caldari Tech Nexus Gemini Federation
|
Posted - 2009.05.18 07:40:00 -
[7]
Edited by: Anders1 on 18/05/2009 07:40:37 I've figured out a bit more about the "vorb" chunk:
struct eve_vorb_chunk { uint32_t unknown1; /* could be number of samples * as this divided by the rate (48000) * seems to give reasonable lengths, * like 5 minutes etc. */
uint32_t unknown2; /* the rest I haven't figured out yet */ uint32_t unknown3; uint32_t unknown4; uint32_t unknown5; uint32_t unknown6; uint32_t unknown7; uint32_t unknown8; uint32_t unknown9; uint32_t unknown10; uint32_t unknown11; } typedef eve_vorb_chunk_t;
which results in:
field offset size value hex unknown1 0 32 bits 15802618 00f120fa unknown2 4 32 bits 15738 00003d7a unknown3 8 32 bits 0 00000000 unknown4 12 32 bits 3893 00000f35 unknown5 16 32 bits 633 00000279 unknown6 20 32 bits 2203653 0021a005 unknown7 24 32 bits 0 00000000 unknown8 28 32 bits 3893 00000f35 unknown9 32 32 bits 356 00000164 unknown10 36 32 bits 15392 00003c20 unknown11 40 32 bits 15760 00003d90
|

Milerna Tyl
|
Posted - 2009.05.21 11:42:00 -
[8]
do you mind that the audio chunk is probably crypted &| packed? :) |

Alexeph Stoekai
Stoekai Corp
|
Posted - 2009.05.21 15:28:00 -
[9]
I will pledge 50m ISK as a reward to the first person to crack these files.
Perhaps it's a bit meagre, but it might serve as an incentive.  -----
|

Catari Taga
Centre Of Attention Rough Necks
|
Posted - 2009.05.22 12:20:00 -
[10]
Originally by: Anders1 For some reason all the EVE music is no longer in mp3, but now in Ogg. Nothing will play these files, which seemed odd, so I looked into it. Turns out these
It was always in Ogg vorbis format, but a pure ogg format. Anyway I just wanted to link you to this thread, might have some helpful info like the link to the sdk for the audio engine.
|
|

Anders1
Caldari Awiora
|
Posted - 2009.05.23 05:49:00 -
[11]
Originally by: Catari Taga
Originally by: Anders1 For some reason all the EVE music is no longer in mp3, but now in Ogg. Nothing will play these files, which seemed odd, so I looked into it. Turns out these
It was always in Ogg vorbis format, but a pure ogg format. Anyway I just wanted to link you to this thread, might have some helpful info like the link to the sdk for the audio engine.
Thanks :)
|

Anders1
Caldari Awiora Gemini Federation
|
Posted - 2009.05.25 23:29:00 -
[12]
I got the latest WWise SDK etc, but when I encode using their Vorbis it seems like a new format. My program can't get the three first Vorbis headers etc (in fact, the string "vorbis" doesn't even show up at all).
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.06.02 10:12:00 -
[13]
Sooooo, I did a lot of reading this weekend and I toyed around with the new files.
It looks like the fmt is just fake placeholder data to get it to be valid (hence the 0xFFFF dev codec header). I have no idea what the vorb actually contains but I'll be taking a second look at that this afternoon to determine if there is anything in there that will give the sample rate.
The data contained in the data bit is (from what I'v been able to determine) a raw vorbis stream. Now, with some fiddeling about and determening the audio packet boundries as specified in the vorbis documentation 4.3 Audio packet decode and synthesis. You'll probably be able to re-pack the vorbis stream into an OggS container.
The only problem I want to figure out before I start coding the damn thing is how to get the PCM audio samples of the stream, since you need that to set the granule position of the OggS headers. How to re-code the vorbis stream into OggS containers is all described in A Embedding Vorbis into an Ogg stream of the manual if you haven't find that already. _
Add your own line! |

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.06.04 11:17:00 -
[14]
Edited by: Sleepkevert on 04/06/2009 11:17:01 From what I'v been reading yesterday / today, it looks like the granule position is only really used for acurate file length determination, and possibly stuff like searchbars and the like. you can still probably play the files without the granule position (or possibly a faked, number calculated from the total number of samples to at least display song length correctly).
I'v got a basic OggS packet packer going (in c# ) As well as a simple RIFF extractor and a start for a vorbis decoder. Code is ugly as hell but it does what it's intended to do. I now face the callenge to go and determine audio packet boundries. Which should be fun figuring out from the setup header and block size... not to mention the setup header size in the first place. But it's all pretty well documented luckily. I'll see if I can spent a couple more hours on it tonight. _
Add your own line! |

Rubbit
|
Posted - 2009.06.07 23:54:00 -
[15]
With Audiokinetics Wwise you can create encoded .BNK files (kinda compiled version) the problem is to decode it then decode "15849750"-"1071976681" files using it.
|

Anders1
Caldari Awiora Gemini Federation
|
Posted - 2009.06.11 05:12:00 -
[16]
Originally by: Sleepkevert Sooooo, I did a lot of reading this weekend and I toyed around with the new files.
It looks like the fmt is just fake placeholder data to get it to be valid (hence the 0xFFFF dev codec header). I have no idea what the vorb actually contains but I'll be taking a second look at that this afternoon to determine if there is anything in there that will give the sample rate.
The data contained in the data bit is (from what I'v been able to determine) a raw vorbis stream. Now, with some fiddeling about and determening the audio packet boundries as specified in the vorbis documentation 4.3 Audio packet decode and synthesis. You'll probably be able to re-pack the vorbis stream into an OggS container.
The only problem I want to figure out before I start coding the damn thing is how to get the PCM audio samples of the stream, since you need that to set the granule position of the OggS headers. How to re-code the vorbis stream into OggS containers is all described in A Embedding Vorbis into an Ogg stream of the manual if you haven't find that already.
Yeah I've already got all that figured out.
Originally by: Sleepkevert Edited by: Sleepkevert on 04/06/2009 11:17:01 From what I'v been reading yesterday / today, it looks like the granule position is only really used for acurate file length determination, and possibly stuff like searchbars and the like. you can still probably play the files without the granule position (or possibly a faked, number calculated from the total number of samples to at least display song length correctly).
I'v got a basic OggS packet packer going (in c# ) As well as a simple RIFF extractor and a start for a vorbis decoder. Code is ugly as hell but it does what it's intended to do. I now face the callenge to go and determine audio packet boundries. Which should be fun figuring out from the setup header and block size... not to mention the setup header size in the first place. But it's all pretty well documented luckily. I'll see if I can spent a couple more hours on it tonight.
Yeah. That's what I don't know either, the audio packet boundaries. The new format in later WWise versions completely remove any references to "vorbis" too, so the first three packets are much harder to get to.. but that's not really a problem for now. But it will be when CCP updates..
What you need to figure out is the format WWise uses. Hints would be some kind of "seek table", at least for the granule pos stuff, but they're optional. Doubt they're in the music files. You can mail me in game if you wanna chat later, easier than using the forum as I don't always check ;) |

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.06.16 08:44:00 -
[17]
I have kinda given up on doing this. Decoding the first two headers is simple enough, but to actually determine the end of the setup header, you have to decode that fully, which is a pita due to bit level specifictions. Messing around with bytes I can do, but grabbing random bits without regards to where those bits are stored in the byte is a frigging pita.
So, without writing a full fledged vorbis decoder it isn't going to be possible to simply re-write it into an OggS container stream. Nicking bits from libvorbis or some other library that already does a lot of the work might be worth it though, they should already have most of the decoding implemented but I don't have the time or patience to look into that at the moment.  _
Add your own line! |

Elaron
Jericho Fraction The Star Fraction
|
Posted - 2009.06.16 18:02:00 -
[18]
Originally by: Anders1 For some reason all the EVE music is no longer in mp3, but now in Ogg. Nothing will play these files, which seemed odd, so I looked into it.
This news story gives the change some perspective, in my opinion. |

Alexeph Stoekai
Stoekai Corp
|
Posted - 2009.06.18 14:05:00 -
[19]
Originally by: Elaron
Originally by: Anders1 For some reason all the EVE music is no longer in mp3, but now in Ogg. Nothing will play these files, which seemed odd, so I looked into it.
This news story gives the change some perspective, in my opinion.
I don't see it. Care to point out what's so enlightening? |

Cory Sopapilla
Minmatar
|
Posted - 2009.06.18 14:52:00 -
[20]
Originally by: Alexeph Stoekai
Originally by: Elaron
Originally by: Anders1 For some reason all the EVE music is no longer in mp3, but now in Ogg. Nothing will play these files, which seemed odd, so I looked into it.
This news story gives the change some perspective, in my opinion.
I don't see it. Care to point out what's so enlightening?
That they're selling it for $$ of course. Click the link. Looking for EVE Online, Vol. 1 (Original Soundtrack) by RealX? Download iTunes and discover what makes it the world's most popular digital media player. Turn your CD collection into a digital music collection. Buy songs for 99ó each. |
|

Hinaj Katsu
Gallente
|
Posted - 2009.06.19 12:48:00 -
[21]
I guess (won't install itunes) it's the same old soundtrack they're selling for years? It contains only a fraction of the tracks used in eve.
|

VheroKai
Vhero' Multipurpose Corp
|
Posted - 2009.06.27 03:03:00 -
[22]
Edited by: VheroKai on 27/06/2009 03:03:37 If you want old (proper) OGG tracks (94 tracks from before the damned change) - here you go... --sig--
Originally by: Bunyip The LOLqual is a capital-sized joke
|

Anders1
Caldari Awiora Gemini Federation
|
Posted - 2009.07.08 01:26:00 -
[23]
Update: would just like to say that I've managed to actually convert EVE music to something you can listen to, but it doesn't sound quite right yet. But it's a major breakthrough!!!
|

Hinaj Katsu
Gallente
|
Posted - 2009.07.13 14:17:00 -
[24]
Thank you very much for the work you've done. |

Anders1
Caldari Awiora Gemini Federation
|
Posted - 2009.07.14 19:19:00 -
[25]
Originally by: Hinaj Katsu Thank you very much for the work you've done.
Thanks, I take it that it worked for you :)
|

Alexeph Stoekai
Stoekai Corp
|
Posted - 2009.07.16 22:57:00 -
[26]
As soon as I can log in (having a corrupted OS, woo!), I shall transfer the ISK pledged.
Excellent work.  -----
|

Anders1
Awiora Gemini Federation
|
Posted - 2009.08.03 20:57:00 -
[27]
I removed the music files from my server, instead use: http://files.getdropbox.com/u/773354/EVEMusic-20090803.torrent. Also has an updated wwiseconv.py.
|

Eugene Spencer
Rodents of Unusual Size
|
Posted - 2009.08.05 11:59:00 -
[28]
Edited by: Eugene Spencer on 05/08/2009 11:58:46 Fantastic! This is great stuff :)
It downloaded super quick. The only issue is the link you provided gives a "malware detected" error in Google Chrome - "Warning: Visiting this site may harm your computer!".
I've uploaded the torrent to my site, so people hopefully won't freak it like I did haha.
http://files.gumpcom.com/EVEMusic-20090803.torrent
|

Anders1
Awiora Gemini Federation
|
Posted - 2009.08.05 21:18:00 -
[29]
Originally by: Eugene Spencer Edited by: Eugene Spencer on 05/08/2009 11:58:46 Fantastic! This is great stuff :)
It downloaded super quick. The only issue is the link you provided gives a "malware detected" error in Google Chrome - "Warning: Visiting this site may harm your computer!".
I've uploaded the torrent to my site, so people hopefully won't freak it like I did haha.
http://files.gumpcom.com/EVEMusic-20090803.torrent
Yeah, Dropbox has been flagged by Google for some reason. I'll update the torrent link in the first post. Thanks for mirroring it.
|

Rootax
Gallente Aeon Cores Corporation
|
Posted - 2009.08.16 16:38:00 -
[30]
Edited by: Rootax on 16/08/2009 16:38:40 Thx you for this !
Few seeders tough... Anyway it's downloading :)
I'll seed like forever after it's finished.
|
|

Anders1
|
Posted - 2009.08.16 22:42:00 -
[31]
Originally by: Rootax Edited by: Rootax on 16/08/2009 16:38:40 Thx you for this !
Few seeders tough... Anyway it's downloading :)
I'll seed like forever after it's finished.
I'm seeding from my server, so shouldn't really be too bad.
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.08.18 15:44:00 -
[32]
Edited by: Sleepkevert on 18/08/2009 15:46:09 So you figured it out after all eh? Nice work! And thanks for the torrent :)
Adding an 100mbit seed in there for half a year orso _
Add your own line! |

Anders1
|
Posted - 2009.08.27 19:26:00 -
[33]
Originally by: Sleepkevert Edited by: Sleepkevert on 18/08/2009 23:57:31 So you figured it out after all eh? Nice work! And thanks for the torrent :)
Adding an 100mbit seed in there for half a year orso
Bla bla long post deleted
Long story short, the files converted play crappy in foobar2000. Turns out it was due to the specific packaging in the converter. The converter was packaging every audio packet into an OGG page. This adds extra overhead since you can easily put about 30-40 packets into a page (this is usualy done). So I adapted some code from the mutagen audio library to do pack it nicely. Upside is that it plays nice in every player and it's a bit smaller due to the removed overhead from the ogg pages (from 198 mb to 170 mb). Downside is that the progress bar in VLC seems to be broken (foobar and winamp work fine though).
The code I used is avaidable here.
Once again, thanks for writing the converter. I'll be enjoying the EVE tracks once again 
Okay, that's really cool. Was just about to say that some of the music is broken (EVE_Rock in particular)... perhaps that solves it? I'll have a look! thanks.
|

Anders1
|
Posted - 2009.08.31 00:43:00 -
[34]
Edited by: Anders1 on 31/08/2009 00:43:14
Originally by: Sleepkevert Edited by: Sleepkevert on 18/08/2009 23:57:31 So you figured it out after all eh? Nice work! And thanks for the torrent :)
Adding an 100mbit seed in there for half a year orso
Bla bla long post deleted
Long story short, the files converted play crappy in foobar2000. Turns out it was due to the specific packaging in the converter. The converter was packaging every audio packet into an OGG page. This adds extra overhead since you can easily put about 30-40 packets into a page (this is usualy done). So I adapted some code from the mutagen audio library to do pack it nicely. Upside is that it plays nice in every player and it's a bit smaller due to the removed overhead from the ogg pages (from 198 mb to 170 mb). Downside is that the progress bar in VLC seems to be broken (foobar and winamp work fine though).
The code I used is avaidable here.
Once again, thanks for writing the converter. I'll be enjoying the EVE tracks once again 
Thanks a lot again for solving the foobar2000 problem. I cleaned up the code and wrote my own function for making larger Ogg pages and it seems to work. Even in VLC! But as I'm on OS X I can't try out foobar2000, and won't release a new torrent until I know it works fine there as well.
I've uploaded the new code to my Dropbox, you can find it there:
EVEMusic-dev.zip
The options are different too:
Usage: wwiseconv.py [options] [args]
Options: --version show program's version number and exit -h, --help show this help message and exit -i FILE, --input=FILE WWise Vorbis to convert -o FILE, --output=FILE save converted audio as FILE -D, --debug enable debug output -v, --verbose enable verbose output -q, --quiet surpress all output -d DESTDIR, --destdir=DESTDIR save files to DEST, only used with --eve-soundbank
EVE Online specific options: -b FILE, --eve-soundbank=FILE use SoundbanksInfo.xml for filenames -p FILE, --eve-playlist=FILE use resPlaylists.stuff for track titles
You need pyYAML installed. This is because I used it to parse the playlists inside the stuff file (for track titles).
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.09.02 08:13:00 -
[35]
Somehow still doesn't play smoothly in foobar. It is definately a lot better though, the speed changes are nearly gone, it sounds like some audio packets, or packet parts are getting dropped.
I'll do some more checking in my break in a few hours, updating foobar, playing with the packer a bit.  _
Add your own line! |

Anders1
|
Posted - 2009.09.03 19:25:00 -
[36]
Edited by: Anders1 on 03/09/2009 19:24:52
Originally by: Sleepkevert Somehow still doesn't play smoothly in foobar. It is definately a lot better though, the speed changes are nearly gone, it sounds like some audio packets, or packet parts are getting dropped.
I'll do some more checking in my break in a few hours, updating foobar, playing with the packer a bit. 
I think I fixed it 100% now actually...
http://dl.getdropbox.com/u/773354/evemusic-20090903.zip
|

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.09.11 02:09:00 -
[37]
updated to 0.9, new version is a lot better/cleaner. I used py2exe/distutils so it should be quite easy for people to use.
if you have the old music, this update is important as it fixes the sound quality!
|

jide
The Nest
|
Posted - 2009.09.11 21:17:00 -
[38]
Do you have another dropbox url for the new version?
RDB |

jide
The Nest
|
Posted - 2009.09.11 21:22:00 -
[39]
Nevermind, I didn't realize you updated the main post. |

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.09.12 01:12:00 -
[40]
Edited by: Anders1 on 12/09/2009 01:12:02 Uploaded a torrent: http://dl.getdropbox.com/u/773354/EVEMusic-20090912.torrent
|
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.09.12 10:56:00 -
[41]
Originally by: Anders1 Edited by: Anders1 on 12/09/2009 01:12:02 Uploaded a torrent: http://dl.getdropbox.com/u/773354/EVEMusic-20090912.torrent
And seeded with an 100mbit line, once the tracker is online >.> _
Add your own line! |

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.09.17 13:34:00 -
[42]
Bad news, they upgraded the WWise library in the version they're using on Singularity. The extractor can't handle these at all.
It looks like they (wwise company) did the following:
Adjust the "vorb" header, adding 2 or so 32 bit fields. This might be some of the data from the comments header. Remove the ident and comments headers. This is OK as they can be recreated. Remove "vorbis" identifier from headers. This shouldn't matter too much as I think the length is at the beginning of the codebooks header.
But I haven't found the packet beginnings / ends yet...
|

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.09.19 08:14:00 -
[43]
Sleepkevert, if you'd like (or anyone else), get "010 editor". It's a hex editor that you can script, and it makes it a lot easier finding packets etc.
I started working on a new format structure script, just load this and one of the sisi .oggs:
/* == typedefs =================================== */
typedef unsigned char u8; typedef unsigned int16 u16; typedef unsigned int32 u32; typedef unsigned int64 u64;
typedef signed char s8; typedef signed int16 s16; typedef signed int32 s32; typedef signed int64 s64;
/* == custom types ================================ */
typedef char ID[4];
typedef char UUID[16] <read=UUIDRead, write=UUIDWrite>;
string UUIDRead(UUID u) { string s; SPrintf(s, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15]); return s; }
void UUIDWrite(UUID &u, string s) { SScanf(s, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15]); }
/* == structures ============================== */
struct RIFFHeader { SetBackColor( cLtGray ); ID magic; u32 chunkSize; ID type; };
/* Generic chunk */ struct UnknownChunk { SetBackColor( cGray ); ID chunkID; u32 chunkSize; char data[chunkSize]; };
struct FormatChunk { SetBackColor( cLtBlue ); ID chunkID; u32 chunkSize;
u16 format; u16 channels; u32 sampleRate; u32 avgByteRate; u16 blockAlign; u16 bitsPerSample; u16 size; if (size == 22) { u16 validBitsPerSample; u32 channelMask; UUID subFormat; } };
struct VorbChunk { SetBackColor( cLtGreen ); ID chunkID; u32 chunkSize;
u32 samples; u32 unknown1; u32 unknown2; u32 unknown3; u32 unknown4; u32 unknown5; u32 seekTableSize; u32 codebooksOffset; u32 unknown8; u32 unknown9; u32 unknown10; u32 checksum; // of what? u32 unknown12; };
struct DataChunk { SetBackColor( cLtYellow ); ID chunkID; u32 chunkSize;
local int origPos = FTell();
u16 codebooksSize; u16 whoKnows; u16 unknown; /* why is codebooksSize above 32-bits and unknown 16-bits */ /* "unknown" is used if codebooksSize is 0 because there's a seek table */
local u32 sz; if (codebooksSize == 0) { sz = unknown - 6; /* what's 6 */ Printf("unknown: %d unknown - 6: %d\n", unknown, unknown - 6); Printf("vorb.unknown3 - sz = %d\n", vorb.unknown3 - sz); SetBackColor(cGray); char seekTable[vorb.seekTableSize]; } else { sz = codebooksSize; Printf("vorb.unknown3 = %d; codebooksSize = %d\n", vorb.unknown3, codebooksSize); Printf("diff: %d\n", vorb.unknown3 - codebooksSize); }
SetBackColor(cLtRed);
char codebooks[sz];
FSeek(origPos + chunkSize); };
/* == read =========================== */
LittleEndian();
local char id[5]; RIFFHeader header;
if (header.magic != "RIFF" || header.type != "WAVE") { Warning("File is not a valid WWise file"); return -1; }
while (!FEof()) { /* peek chunk ID */ ReadBytes(id, FTell(), 4); id[4] = 0;
switch (id) { case "fmt ": FormatChunk fmt; break;
case "vorb": VorbChunk vorb; break;
case "data": DataChunk data; break;
default: UnknownChunk unknown; break; } }
local u32 riffHeaderSize = 12; local u32 fmtHeaderSize = 8 + fmt.chunkSize; local u32 vorbHeaderSize = 8 + vorb.chunkSize; local u32 dataOffset = 8 + riffHeaderSize + fmtHeaderSize + vorbHeaderSize; Printf("offset to data: %d\n", dataOffset); Printf("offset to codebooks end: %d\n", dataOffset + vorb.codebooksOffset);
of course, some of it is just guesswork
|

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.09.25 17:55:00 -
[44]
I'm completely stuck... I know basically what's different about the format now, but I can't really do it.
The last codebook is a custom one, not decodable, probably contains wwise-specific info. I don't know how to deal with bitstreams in a hex editor as they aren't byte aligned making things really annoying.
here's my current extractor (which doesn't work)
import os import struct from cStringIO import StringIO import sys
from mutagen.ogg import OggPage
class RIFF(object): def __init__(self, stream): self.stream = stream self.magic, self.size, self.type = struct.unpack('<4sL4s', stream.read(12))
class RIFFChunk(object): def __init__(self, riff): self.id, self.size = struct.unpack('<4sL', riff.stream.read(8)) self.data = riff.stream.read(self.size)
class FormatChunk(RIFFChunk): def __init__(self, riff): super(FormatChunk, self).__init__(riff) unpacked =struct.unpack('<HHLLHHHHL16s', self.data) self.format = unpacked[0] self.channels = unpacked[1] self.sample_rate = unpacked[2] self.avg_byte_rate = unpacked[3] self.block_align = unpacked[4] self.bits_per_sample = unpacked[5] self.extension_size = unpacked[6] self.valid_bits_per_sample = unpacked[7] self.channel_mask = unpacked[8] self.sub_format = unpacked[9]
class VorbChunk(RIFFChunk): def __init__(self, riff): super(VorbChunk, self).__init__(riff)
unpacked = struct.unpack('<LLLLBBHLLLLLLLL', self.data) self.samples = unpacked[0] self.blocksize = unpacked[4] self.checksum = unpacked[13] self.audio_offset = unpacked[9]
class AudioPacket(object): def __init__(self, stream): self.size, self.granule_pos = struct.unpack('<HL', stream.read(6)) self.data = stream.read(self.size)
class DataChunk(RIFFChunk): def __init__(self, riff): self.id, self.size = struct.unpack('<4sL', riff.stream.read(8)) self.data = StringIO(riff.stream.read(self.size))
def main(): f = open(r'C:\Sisi\res\audio\336401897.ogg', 'rb') riff = RIFF(f) fmt = FormatChunk(riff) vorb = VorbChunk(riff) data = DataChunk(riff)
pages = []
bsizes = {64: 6, 128: 7, 4096: 12, 1024: 10, 8192: 13, 256: 8, 512: 9, 2048: 11}
# hardcoded values os = StringIO() os.write('\x01vorbis') os.write(struct.pack('<L', 0)) # vorbis version os.write(struct.pack('<B', 2)) # channels os.write(struct.pack('<L', 48000)) # rate os.write(struct.pack('<L', 0)) # bitrate max os.write(struct.pack('<L', 48000)) # bitrate nominal os.write(struct.pack('<L', 0)) # bitrate min os.write(struct.pack('<B', 0xc9)) # should be correct.. although i got it to 0x9c first, but then it complains as blocksize_0 > blocksize_1. so use c9. os.write('\x01')
page = OggPage() page.packets.append(os.getvalue()) pages.append(page)
os = StringIO() os.write('\x03vorbis') vendor = 'WWise unknown' os.write(struct.pack('<L', len(vendor))) os.write(vendor) os.write(struct.pack('<L', 0)) # comment list length os.write('\x01')
page = OggPage() page.packets.append(os.getvalue()) pages.append(page)
max_len = 0
stream = data.data count = 0 while data.size - stream.tell() > 0: count = count + 1 packet = AudioPacket(stream) #print "read %d packets" % count
# first packet contains the codebooks if count == 1: os = StringIO() os.write('\x05vorbis') os.write(packet.data) page = OggPage() page.packets.append(os.getvalue()) pages.append(page) else: page = OggPage() page.position = packet.granule_pos page.packets.append(packet.data) pages.append(page)
pages[0].first = True pages[-1].last = True for n in range(len(pages)): p = pages[n] p.serial = 0x31337 p.sequence = n
out = open(r'c:\anders.ogg', 'wb') for page in pages: out.write(page.write()) out.close()
if __name__ == '__main__': main()
|

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.10.04 13:30:00 -
[45]
Managed to play the new format using a hacked libvorbis and a simple extractor, but it's not perfect.
TODO list:
- figure out vorb chunk - should be easier because I've got a few tricks for that now
- figure out where the blocksize is stored (4 + 4 bits)
ATM I just create my own Vorbis ident header with some info that is correct, but it wouldn't work with any other song.
The differences in the new format are as follows (from regular vorbis):
No ident and comment headers. Setup header doesn't start with "\x05vorbis". Not using Ogg, uses a custom RIFF based format with info in "vorb" chunk, and the audio data + setup header in the "data" chunk.
The "time" bit is removed - the code in WWise is simply commented out I assume, which makes regular vorbis barf. need to readd that.
|

Emma Royd
Caldari Maddled Gommerils
|
Posted - 2009.10.06 08:00:00 -
[46]
Or you would wait till dominion, the music is stored as mp3 then with customizable jukebox so you can play your own music etc 
"To Do Is To Be" - Nietzsche "To Do Is To Do" - Kant "Do Be Do Be Do" - Sinatra |

Anders1
The Order of Chivalry Nex Eternus
|
Posted - 2009.10.06 16:43:00 -
[47]
Originally by: Emma Royd Or you would wait till dominion, the music is stored as mp3 then with customizable jukebox so you can play your own music etc 
Not all of the music is available as .mp3. There's a lot of music that plays when you warp into deadspace and such, not just the "boring" ambient music.
|

Anders1
Volatile Instability
|
Posted - 2009.12.03 10:42:00 -
[48]
Dominion is upon us, and the tool I have at http://bitbucket.org/anders/wwiseconv doesn't really work yet, except on some of the larger .oggs (which happens to be most, if not all, of the music).
In the Wwise code they have a modified Vorbis decoder with a function called "vorbis_info_init", taking 3 parameters (instead of the usual 1):
codec setup info blocksize0 blocksize1
blocksize0 and blocksize1 have to be found and bit shifted a bit and then written to the Vorbis identification header in order to play the files. The current value I found by creating a soundbank and then replacing one of the .oggs with an EVE one + a breakpoint on that function... this sucks. Doubt I can fix it to be honest
|
|
|
|
Pages: 1 2 :: [one page] |