Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Modding

Reply
 
Thread Tools
Old 22-05-15, 10:07   #201
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

Hi guys, I need your help.
I'm trying to change audio tracks inside *.awd files but I can't figure out what kind of codec they used for audio data. It's something like 4 bit ADPCM but I've already tried with Microsoft and IMA ADPCM and both sounds horrible (noisy and distorted).
I'm using the PC version of the game.
Thank you!
nakamichi680 is offline   Reply With Quote
Old 22-05-15, 12:34   #202
Suikaze Raider
Member
 
Suikaze Raider's Avatar
 
Joined: May 2007
Posts: 473
Smile

Core Design used a custom IMA ADPCM audio with TR3 FMV's using the VideoStudio 2.1 by Eidos Interactive, but I don't think they used this format with AOD...

Could you release the file struct, please? I'm interested too, for can do new dubs and fixes.

Regards
Suikaze Raider is offline   Reply With Quote
Old 22-05-15, 14:46   #203
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

Quote:
Originally Posted by Suikaze Raider View Post
Core Design used a custom IMA ADPCM audio with TR3 FMV's using the VideoStudio 2.1 by Eidos Interactive, but I don't think they used this format with AOD...

Could you release the file struct, please? I'm interested too, for can do new dubs and fixes.

Regards
With custom you mean a modded IMA ADPCM codec? Can it be downloaded somewhere?

This is what I've discovered as far working with awd2wav and hexeditor.

http://i.imgur.com/39BNKYx.jpg

This picture is from a cutscene awd file. The file structure is almost the same of a regular level awd file but it is easier because it contains only one audio file.
The first part of the file contains a list of events and related sounds. When the game calls an event (for instance 05 00 00 9F) the associated audio file is played (00 01 AA F5 in this case).

I put quotation marks in "constant" because that sequence sometimes changes between 00 45 58 04 and 0A 45 58 04 (I don't know why).

The second part is the list of audio files contained in the awd. In this case it is immediately followed by the data chunk because this awd contains only one file.
"Audio data block size" is referred to each audio clip, not the whole data chunk.
I'm not sure of the beginning point of the data chunk. What is 100% sure is that files are stored in a 4-bit/sample codec.

Sorry for bad english.

Last edited by Greenkey2; 19-06-15 at 15:33. Reason: Oversized image
nakamichi680 is offline   Reply With Quote
Old 24-05-15, 12:30   #204
Suikaze Raider
Member
 
Suikaze Raider's Avatar
 
Joined: May 2007
Posts: 473
Smile

I posted the link in my message; you can find it the decoder code: Here.

That language ID is different in every language in "cs_15_24.awd" file:
Quote:
English: 00 01 AA EF
French: 00 01 AA F1
German: 00 01 AA F3
Italian: 00 01 AA F5
Spanish: 00 01 AA F7
Brazilian: 00 03 9C 65
Japanese: 00 03 39 31
Korean: 00 03 7A 48
I think the file struct could be something like that:
Quote:
//Header Start.
bitu8[4] Awad_Tag; //"AWAD"
bitu32 Number_Of_Audio_Types; //Usually: 5. In Japanese Version: 8.

//The name is the level/cutscene name plus an extension:
//".AOB" - Unknown.
//".SRD" - Game Samples.
//".STI" - Unknown.
//".STD" - Voices.
//".SCD" - Game Music + Scream Sample + Suffocate Sample.

struct{
bitu8[12] Type_Name;
bitu32 Type_Unknown1;
bitu32 Type_Unknown2;
bitu32 Type_Unknown3;
bitu32 Type_Unknown4;
}Audio_Types[Number_Of_Audio_Types]; //28bytes every item.

//Unknown Value 1.
bitu32 Unknown1;

//Cash Zone.
bitu8[4] Cash_Tag; //"CASH"
bitu32 Cash_Size; //In Bytes.
bitu8[Cash_Size] Cash_Data;

//Sample Zone.
struct{
bitu8[4] Smpl_Tag; //"SMPL"
bitu32 Smpl_Size; //In Bytes.
bitu8[Smpl_Size] Smpl_Data;
}Smpl_List[???];

//Event Zone.
struct{
bitu8[4] Evnt_Tag; //"EVNT"
bitu32 Evnt_Size; //In Bytes.
bitu8[Evnt_Size] Evnt_Data;
}Evnt_List[???];

//Object Zone.
struct{
bitu8[4] Objt_Tag; //"OBJT"
bitu32 Objt_Size; //In Bytes + 2?
bitu8[Objt_Size] Objt_Data;
}Objt_List[???];

//Smpd Zone.
bitu8[4] Smpd_Tag; //"SMPD"
bitu32 Smpd_Size; //In Bytes.
bitu8[Smpd_Size] Objt_Data;

//Stri Zone.
bitu8[4] Stri_Tag; //"STRI"
bitu32 Number_Of_Samples;
bitu32[Number_Of_Samples] List_Of_Samples_ID;
bitu32[Number_Of_Samples] List_Of_Samples_Offset;
bitu32 Samples_Size;
bitu8[Samples_Size] Samples_Data;
if "Number_Of_Audio_Types" is 8 the file repeat the sections "Cash", "Smpl", "Evnt", "Objt" and "Stri" again after of first "Samples_Data".

Best Regards

Last edited by Suikaze Raider; 24-05-15 at 16:16. Reason: Updating.
Suikaze Raider is offline   Reply With Quote
Old 25-05-15, 12:25   #205
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

Thank you for your reply. That list is very useful.
Unfortunately I don't have enough knowledge to understand how to use information provided by the link to properly read samples_data.
nakamichi680 is offline   Reply With Quote
Old 26-05-15, 11:12   #206
Suikaze Raider
Member
 
Suikaze Raider's Avatar
 
Joined: May 2007
Posts: 473
Smile

Unfortunately, I don't understand that code fully...

I tried import the RAW data in Adobe Audition, but it was noised a lot always... I tried inverted the nibbles of every byte too, but the result was the same

Regards.
Suikaze Raider is offline   Reply With Quote
Old 26-05-15, 12:19   #207
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

Quote:
Originally Posted by Suikaze Raider View Post
Unfortunately, I don't understand that code fully...

I tried import the RAW data in Adobe Audition, but it was noised a lot always... I tried inverted the nibbles of every byte too, but the result was the same

Regards.
I did the same without luck. I've also tried with sox (a command line audio converter) and the result was slightly better but still noisy. The program wasn't able to recognize left and right audio track so it merged them in a single mono track.


BTW you forgot SGRP and SGRE zones between Sample zone and Event zone. The structure is the same of other parts, it should be something like this:

//Sgrp Zone.
bitu8[4] Sgrp_Tag; //"SGRP"
bitu32 Sgrp_Size; //In Bytes.
bitu8[Sgrp_Size] Sgrp_Data;

//Sgre Zone.
bitu8[4] Sgre_Tag; //"SGRE"
bitu32 Sgre_Size; //In Bytes.
bitu8[Sgre_Size] Sgre_Data;

Here some of other discoveries I've made on Sample zone:

http://i.imgur.com/tzeyb0t.jpg

If you notice some samples have "00 00 00 00" as lenght. These are stream samples and they're "jumped" in this part of the awd file because their lenght is written later in the STRI zone.

Last edited by Greenkey2; 19-06-15 at 15:33. Reason: Images are waay too big
nakamichi680 is offline   Reply With Quote
Old 19-06-15, 14:02   #208
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

I'm currently working on a PC version of ending credits.
The easiest way was to record credits from PS2 and then add the video at end.mpg video of PC version. But it would look like horrible so I decided to do a remake of the credits in 4K resolution.
Here's a preview of the first screenshot.

Original:

http://i.imgur.com/ynAA857.jpg


4K Remake:

http://i.imgur.com/Seoi939.jpg

Of course I'll do a 1080p version because few PCs are strong enough to run a 4K video.

Last edited by nakamichi680; 19-06-15 at 16:16. Reason: Images were waaaay too big
nakamichi680 is offline   Reply With Quote
Old 19-06-15, 15:32   #209
Greenkey2
Member
 
Greenkey2's Avatar
 
Joined: Jul 2005
Posts: 17,433
Arrow Image sizes

Welcome to the forums, nakamichi680

I've converted your images to links because they exceeded the forum's guidelines. They were stretching the forum's layout and people with slower connections would have had to wait way too long for the page to load. In future, please either keep within the 1024x768 pixel / 500kb limit, or post them as links
Greenkey2 is offline   Reply With Quote
Old 19-06-15, 16:15   #210
nakamichi680
Member
 
nakamichi680's Avatar
 
Joined: Feb 2015
Posts: 874
Default

Quote:
Originally Posted by Greenkey2 View Post
Welcome to the forums, nakamichi680

I've converted your images to links because they exceeded the forum's guidelines. They were stretching the forum's layout and people with slower connections would have had to wait way too long for the page to load. In future, please either keep within the 1024x768 pixel / 500kb limit, or post them as links


ooops, I'm so sorry

I'll pay more attention in the future
nakamichi680 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 19:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.