Join also our Discord channel! Click here.

EA Layer 3 Extractor/Decoder

Get help on any and all audio formats, or chip in and help others!
jfwfreo
veteran
Posts: 96
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 18 times

Re: EA Layer 3 Extractor/Decoder

Post by jfwfreo » Sun Aug 21, 2016 10:04 am

daemon1 wrote:
jfwfreo wrote:Well, their format IS actually normal mp3. The only thing they did is storing mp3 data in their own structure. Why? No idea.
Its normal MP3 with their own custom header and the weird "uncompressed samples" stuff at the end.

daemon1
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2204
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 53 times
Been thanked: 1810 times

Re: EA Layer 3 Extractor/Decoder

Post by daemon1 » Sun Aug 21, 2016 10:08 am

uncompressed samples may also be in the beginning if i remember correctly

jfwfreo
veteran
Posts: 96
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 18 times

Re: EA Layer 3 Extractor/Decoder

Post by jfwfreo » Sun Aug 21, 2016 2:07 pm

Ok so I think I finished playing with EALayer3 now. Things I discovered (and that aren't in the "ea layer 3.txt" file in the ealayer3 code)
For "version 5" data, the first 8 bits have to be 0xEE for the "uncompressed samples present" code to trigger, not "non zero" as the docs imply.
For "version 6/7" data, the second bit in the header (currently marked "unknown") is channel count - 1 (so 0 for mono and 1 for stereo)
The enum used for the "mode" flag in the extended header for "version 6/7" data looks like this
enum rw::audio::core::BlockOffsetMode
{
BLOCKOFFSETMODE_IGNORE = 0x0,
BLOCKOFFSETMODE_PRESERVE = 0x1,
BLOCKOFFSETMODE_MUTE = 0x2,
BLOCKOFFSETMODE_MAX = 0x3,
};
And finally, the function that decodes the "uncompressed" sample data in "version 5" files is named DecodeSpecialBlock. For "version 6/7" files the decode function is named DecodePcm. Not sure why they called it a "special block" for the "version 5" files, just seems weird that they did that.

That's it for interesting EALayer3 discoveries :)

jfwfreo
veteran
Posts: 96
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 18 times

Re: EA Layer 3 Extractor/Decoder

Post by jfwfreo » Mon Aug 22, 2016 8:37 am

Just wanted to say thanks for figuring out that .mus stuff.
There is a related file format (doesn't contain actual audio data but will contain references to the .mus file) called .mpf. I have uploaded a sample mpf file here. The MPF file is connected to data called "PathMusicMap" by the game.
https://mega.nz/#!e9ExFLbY!7uqs3qW-uHb0 ... Nq_FgdpBB0
If anyone can help me figure out its format, I would be very grateful (its one of the only formats in Red Alert 3 that can't currently be edited)

daemon1
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2204
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 53 times
Been thanked: 1810 times

Re: EA Layer 3 Extractor/Decoder

Post by daemon1 » Tue Aug 23, 2016 5:07 pm

Checked the file. If anyone will be going to figure out its format, he will also need the files that its connected to. Maybe even the whole game. Because it doesn't contain actual data, but only references, its natural that'd be impossible to figure anything out without the actual data it refers to.

jfwfreo
veteran
Posts: 96
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 18 times

Re: EA Layer 3 Extractor/Decoder

Post by jfwfreo » Tue Aug 23, 2016 10:01 pm

As far as I am aware, the only data that the mpf file (which goes with the PathMusicMap data) should be referencing is the PathMusicTrack data (the .mus file). The game has 2 of them, the smaller of the 2 is what I uploaded earlier.

I suspect the best way forward is to go back to my reverse engineering notes from before and continue reverse engineering as much as I can and then write it all up (with data structure definitions, notes and mega.nz links to the various data files involved) and then see if anyone out there can help me fill in the blanks.

jfwfreo
veteran
Posts: 96
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 18 times

Re: EA Layer 3 Extractor/Decoder

Post by jfwfreo » Thu Aug 25, 2016 11:54 am

I have posted all my notes on the PathMusic stuff in viewtopic.php?f=17&t=14927
Hopefully someone will be able to help me reverse engineer all the remaining pieces in the files so its possible to change these files and mess with this data...

PixelBoyZ69
n00b
Posts: 13
Joined: Fri May 12, 2017 7:05 pm

Re: EA Layer 3 Extractor/Decoder

Post by PixelBoyZ69 » Sat May 13, 2017 3:10 am

Sorry to bump this forum but i just want to ask...

searching the BF1 Soundtrack somewhere in "sound" folder, found all the EBX File but dunno how to figure out where is the audio (Soundtrack) files located, because some of them are kinda like a trap file for me (some of the EBX are not the Audio Files)

User avatar
Vosvoy
veteran
Posts: 127
Joined: Fri Feb 18, 2011 4:58 pm
Has thanked: 15 times
Been thanked: 15 times

Re: EA Layer 3 Extractor/Decoder

Post by Vosvoy » Mon May 15, 2017 1:42 pm

PixelBoyZ69 wrote:Sorry to bump this forum but i just want to ask...

searching the BF1 Soundtrack somewhere in "sound" folder, found all the EBX File but dunno how to figure out where is the audio (Soundtrack) files located, because some of them are kinda like a trap file for me (some of the EBX are not the Audio Files)
Did you look in the "Levels" subfolder in the main folder "Sounds" after sound extraction? I remember clearly finding musics loops and stuff in that subfolder (like the epic fight music "Metal Frenzy" in the Storm of Steel mission: "Sounds\Levels\SP\E0\Music\SP_E0_Prologue_CombatInfantry4CH_Loop_Wave 0 0 0.wav"). You will even be able to find unique sound effects only used in those levels, in the same directory (like, again in the prologue, the scream of the guy who's rushing at the character in the outro), if you're interested.

But, if you're looking for the musics in the background from the main menu (like Dawn of a New Time, that I personaly love to the bones), check this subfolder: "Sounds\Music\FrontEnd"

Cordialy
Vosvoy

Post Reply