Dragon Age: Inquisition Modding Tools

All about modding tools for Dragon Age: Inquisition
It is currently Sat Jun 24, 2017 5:21 am

All times are UTC



Welcome
Welcome to the Dragon Age Modding tools forum

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!


Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 31 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Audio extraction
PostPosted: Thu Dec 18, 2014 9:06 am 
Offline
Site Admin
User avatar

Joined: Fri Dec 05, 2014 3:43 am
Posts: 629
Has thanked: 14 time
Have thanks: 751 time
Okay scratch that, right now its too difficult. Firstly most sounds are stored in loc/en.sb (not the cas files, so they need to be extracted from there) and secondly sounds have no resource, they are only chunks, so even trying to find them is painful, the EBX files themselves have a pointer to the ChunkID, but does not necessarily reside in the same bundle or super bundle.
Ehamloptiran has been thanked by:


Top
 Profile  
 
 
 Post subject: Re: Audio extraction
PostPosted: Thu Dec 18, 2014 10:42 am 
Offline
Site Admin

Joined: Fri Dec 05, 2014 12:05 pm
Posts: 179
Has thanked: 35 time
Have thanks: 212 time
well nothing to do for me then

greetz WV

_________________
Always backup your files!


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Thu Dec 18, 2014 2:13 pm 
Offline
Site Admin

Joined: Fri Dec 05, 2014 12:05 pm
Posts: 179
Has thanked: 35 time
Have thanks: 212 time
well it still doesnt stop me from making an splitter tool, but I think the right way would be searching ebx objects for sound references, anyway, here a lil tool I wrote in my break:

Image

just drop a chunk file on it and it will extract all parts

https://www.mediafire.com/?g2ob4vno4a5q7ga

greetz WV

PS:found bug, reuploaded it

_________________
Always backup your files!
WarrantyVoider has been thanked by:


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Thu Dec 18, 2014 6:56 pm 
Offline
Site Admin

Joined: Fri Dec 05, 2014 12:05 pm
Posts: 179
Has thanked: 35 time
Have thanks: 212 time
ok that was fun for 10 mins. here I added the ealayer3 tool to auto convert the files to mp3 :D until we have implemented proper audio extraction/searching this should help a bit :D

Image

https://www.mediafire.com/?8pyc7xdlj24so65

greetz WV

_________________
Always backup your files!
WarrantyVoider has been thanked by:


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Thu Apr 02, 2015 8:32 pm 
Offline

Joined: Thu Apr 02, 2015 8:25 pm
Posts: 4
Has thanked: 0 time
Have thanks: 3 time
A user on another forum asked me if I can extract the audio from DAI. Strange that he sent me bard songs, when Ehamloptiran said he was able to convert them all. Anyway, the files were extracted wrong. There are occasional 8 bytes missing or 8 extra bytes in the audio string.

So every 64 kbytes Ealayer3 stops with an error, without even producing any output.
iddaemon has been thanked by:


Last edited by iddaemon on Sat Apr 04, 2015 3:03 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Fri Apr 03, 2015 2:06 am 
Offline
Site Admin

Joined: Fri Dec 05, 2014 3:26 pm
Posts: 635
Has thanked: 921 time
Have thanks: 314 time
bard songs were given out for free by Bioware, no need to extract them

_________________
ar-lath-ma-vhenan


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Sat Apr 04, 2015 3:01 pm 
Offline

Joined: Thu Apr 02, 2015 8:25 pm
Posts: 4
Has thanked: 0 time
Have thanks: 3 time
Renmiri wrote:
bard songs were given out for free by Bioware, no need to extract them


Yes, but the sound extraction here in DAI Tools is completely wrong. The audio format is usual Ealayer3 and XAS, but it can't be extracted with current DAI Tools version. So I was wondering if it was working before, then this error was introduced in the latest changes. How can we fix it now? I can help with sound blocks/chunks format.

p.s. modified previous post, because the problem is not in ealayer3

This is the structure of a block header. Each chunk can consist of many blocks, any of them may be compressed or not. But it seems DAI tools just try to extract it all as a single block

Code:
int32 - original size
byte  - compression
          0 - none
          2 - zlib
          9 - lz77
byte  - flag
         70 - uncompressed block
         71 - last uncompressed block
         70 - compressed block
int16 - real size (in file)
iddaemon has been thanked by:


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Sun Apr 05, 2015 10:04 am 
Offline

Joined: Thu Apr 02, 2015 8:25 pm
Posts: 4
Has thanked: 0 time
Have thanks: 3 time
And about the audio files.

0x4800000C is not a "magic number". It's just an audio block start header, just like 0x44 and 0x45 for audio block and audio end. 0x0C is the length of it, and it is not always 12 bytes, there's a lot of 0x14 bytes headers in Dead Space 3 for example.

Then, audio files can have an extra metadata in the beginning. Those start with 0x011006C0. I don't know what it is, researching this now. In DAI there's about 9000 audio files without it (total size 4GB), and about 2000 with it (total size 2GB). So these audio with metadata are the longest, probably music and ambient files. Though some of them are really short animal sounds too.
iddaemon has been thanked by:


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Sun Apr 05, 2015 2:16 pm 
Offline
Site Admin

Joined: Fri Dec 05, 2014 12:05 pm
Posts: 179
Has thanked: 35 time
Have thanks: 212 time
where do you got these information? for me it was usually just extracting the data, cut headers and find a program to convert them, I didnt had such format definitions. do you have more?

greetz WV

_________________
Always backup your files!


Top
 Profile  
 
 Post subject: Re: Audio extraction
PostPosted: Sun Apr 05, 2015 3:13 pm 
Offline

Joined: Thu Apr 02, 2015 8:25 pm
Posts: 4
Has thanked: 0 time
Have thanks: 3 time
WarrantyVoider wrote:
where do you got these information? for me it was usually just extracting the data, cut headers and find a program to convert them, I didnt had such format definitions. do you have more?


I was able to find it myself during the last half year research of EA audio formats in different games.

The audio files in this case are split into blocks like all other chunks in Frostbyte engine. I can't find a place in DAI tools code where the chunk is extracted and this part also looks treaky for me

Spoiler:
Code:
            int offset = seg.offset;
            if (offset < 0)
                return new byte[0];
            int toffset = -1;
            for (int i = offset; i >= 0; i--)
                if (data[i] == 0x48 &&
                    data[i + 1] == 0x00 &&
                    data[i + 2] == 0x00 &&
                    data[i + 3] == 0x0C)
                {
                    toffset = i;
                    break;
                }
            if (toffset == -1 || offset - toffset > 0x10000)
            {
                int toffset3 = -1;
                for (int i = offset; i < data.Length; i++)
                    if (data[i] == 0x48 &&
                        data[i + 1] == 0x00 &&
                        data[i + 2] == 0x00 &&
                        data[i + 3] == 0x0C)
                    {
                        toffset3 = i;
                        break;
                    }
                if (toffset3 != -1 && toffset3 - offset < 0x10000)
                    toffset = toffset3;

            }
            offset = toffset;
            int size = data.Length - offset;
            if (segment + 1 < sound.segments.Count)
            {
                int offset2 = sound.segments[segment + 1].offset;
                toffset = -1;
                for (int i = offset2; i > 0; i--)
                    if (data[i] == 0x48 &&
                        data[i + 1] == 0x00 &&
                        data[i + 2] == 0x00 &&
                        data[i + 3] == 0x0C)
                    {
                        toffset = i;
                        break;
                    }
                if (toffset == -1 || toffset == offset)
                {
                    int toffset3 = -1;
                    for (int i = offset2; i < data.Length; i++)
                        if (data[i] == 0x48 &&
                            data[i + 1] == 0x00 &&
                            data[i + 2] == 0x00 &&
                            data[i + 3] == 0x0C)
                        {
                            toffset3 = i;
                            break;
                        }
                    if (toffset3 != -1 && toffset3 - offset2 < 0x10000)
                        toffset = toffset3;
                }
                size = toffset - offset;
            }


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 31 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred